{"id":21291503,"url":"https://github.com/postfinance/flash","last_synced_at":"2025-03-15T16:34:04.178Z","repository":{"id":46599002,"uuid":"323901447","full_name":"postfinance/flash","owner":"postfinance","description":"Configures an opinionated zap logger.","archived":false,"fork":false,"pushed_at":"2023-04-14T11:03:02.000Z","size":69,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-01-22T06:22:27.672Z","etag":null,"topics":["logger","zap"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postfinance.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-23T12:52:23.000Z","updated_at":"2021-10-14T07:38:07.000Z","dependencies_parsed_at":"2024-06-21T13:00:46.703Z","dependency_job_id":"c451d5ea-b4fe-4d17-b863-517410f0e4ef","html_url":"https://github.com/postfinance/flash","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfinance%2Fflash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfinance%2Fflash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfinance%2Fflash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfinance%2Fflash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postfinance","download_url":"https://codeload.github.com/postfinance/flash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243760419,"owners_count":20343628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logger","zap"],"created_at":"2024-11-21T13:34:01.587Z","updated_at":"2025-03-15T16:34:04.147Z","avatar_url":"https://github.com/postfinance.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/postfinance/flash)](https://goreportcard.com/report/github.com/postfinance/flash)\n[![Coverage Status](https://coveralls.io/repos/github/postfinance/flash/badge.svg?branch=main)](https://coveralls.io/github/postfinance/flash?branch=main)\n[![Build Status](https://github.com/postfinance/flash/workflows/build/badge.svg)](https://github.com/postfinance/flash/actions)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/postfinance/flash)](https://pkg.go.dev/github.com/postfinance/flash)\n# flash\nCreates an opinionated zap logger.\n\n## Adapting it as a `logr.Logger` instance\n\nShall you at some point need to pass a `logr.Logger` instance in your code, e.g. while writing code that uses the \nKubernetes client library etc., you can use `go-logr/zapr` to wrap the logger, as follows:\n\n```golang\npackage main\n\nimport (\n\t\"github.com/go-logr/zapr\"\n\t\"github.com/postfinance/flash\"\n)\n\nfunc main() {\n\tl := flash.New()\n\tz := zapr.NewLogger(l.Desugar())\n        z.V(0).Info(\"I'm a zap logger complying with logr.Logger interface !\")\n}\n```\n\n## Logger Without Stacktrace\n### New Logger\n\u003e Debug / Info / Error\n```\n2020-10-09T09:29:06.363+0200    INFO    test/main.go:26 message {\"StackTrace\": \"off\", \"debug\": false}\n2020-10-09T09:29:06.364+0200    ERROR   test/main.go:27 message {\"StackTrace\": \"off\", \"debug\": false}\n```\n\n### Enable Debug\n\u003e Debug / Info / Error\n```\n2020-10-09T09:29:06.364+0200    DEBUG   test/main.go:33 message {\"StackTrace\": \"off\", \"debug\": true}\n2020-10-09T09:29:06.364+0200    INFO    test/main.go:34 message {\"StackTrace\": \"off\", \"debug\": true}\n2020-10-09T09:29:06.364+0200    ERROR   test/main.go:35 message {\"StackTrace\": \"off\", \"debug\": true}\n```\n\n### Disable Debug\n\u003e Debug / Info / Error\n```\n2020-10-09T09:29:06.364+0200    INFO    test/main.go:42 message {\"StackTrace\": \"off\", \"debug\": false}\n2020-10-09T09:29:06.364+0200    ERROR   test/main.go:43 message {\"StackTrace\": \"off\", \"debug\": false}\n```\n\n\u003e Fatal\n```\n2020-10-09T09:29:06.364+0200    FATAL   test/main.go:47 message {\"StackTrace\": \"on\", \"debug\": false}\nexit status 1\n```\n\n## Logger With Stacktrace\n### New Logger\n\u003e Debug / Info / Error\n```\n2020-10-09T09:29:11.889+0200    INFO    test/main.go:26 message {\"StackTrace\": \"off\", \"debug\": false}\n2020-10-09T09:29:11.889+0200    ERROR   test/main.go:27 message {\"StackTrace\": \"off\", \"debug\": false}\n```\n\n### Enable Debug (Stacktrace on Error or above)\n\u003e Debug / Info / Error\n```\n2020-10-09T09:29:11.889+0200    DEBUG   test/main.go:33 message {\"StackTrace\": \"off\", \"debug\": true}\n2020-10-09T09:29:11.889+0200    INFO    test/main.go:34 message {\"StackTrace\": \"off\", \"debug\": true}\n2020-10-09T09:29:11.889+0200    ERROR   test/main.go:35 message {\"StackTrace\": \"off\", \"debug\": true}\nmain.main\n        /export/home/sauterm/tmp/test/main.go:35\nruntime.main\n        /export/home/sauterm/.gimme/versions/go1.15.2.linux.amd64/src/runtime/proc.go:204\n```\n\n###  Disable Debug (Stacktrace on Fatal only)\n\u003e Debug / Info / Error\n```\n2020-10-09T09:29:11.889+0200    INFO    test/main.go:42 message {\"StackTrace\": \"off\", \"debug\": false}\n2020-10-09T09:29:11.889+0200    ERROR   test/main.go:43 message {\"StackTrace\": \"off\", \"debug\": false}\n```\n\n\u003e Fatal\n```\n2020-10-09T09:29:11.889+0200    FATAL   test/main.go:47 message {\"StackTrace\": \"on\", \"debug\": false}\nmain.main\n        /export/home/sauterm/tmp/test/main.go:47\nruntime.main\n        /export/home/sauterm/.gimme/versions/go1.15.2.linux.amd64/src/runtime/proc.go:204\nexit status 1\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostfinance%2Fflash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostfinance%2Fflash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostfinance%2Fflash/lists"}