{"id":19383325,"url":"https://github.com/mdouchement/logger","last_synced_at":"2026-02-26T08:39:19.082Z","repository":{"id":57521820,"uuid":"252995295","full_name":"mdouchement/logger","owner":"mdouchement","description":"A simple prefixer logger that can wrap several backends.","archived":false,"fork":false,"pushed_at":"2025-04-29T13:32:06.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T17:54:20.757Z","etag":null,"topics":["logger","logrus","prefixer"],"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/mdouchement.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2020-04-04T12:48:44.000Z","updated_at":"2025-07-12T15:11:32.000Z","dependencies_parsed_at":"2024-06-21T17:50:40.671Z","dependency_job_id":"8d4278ee-f985-4e0f-ae92-fdaed6c04bbb","html_url":"https://github.com/mdouchement/logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdouchement/logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdouchement","download_url":"https://codeload.github.com/mdouchement/logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdouchement%2Flogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29854025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","logrus","prefixer"],"created_at":"2024-11-10T09:25:35.432Z","updated_at":"2026-02-26T08:39:19.064Z","avatar_url":"https://github.com/mdouchement.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logger\n\nA simple prefixer logger that can wrap several backends. The formatters/handlers from this repository must be used in order to make prefix work.\n\n\n## Interface\n\n```go\ntype Logger interface {\n\tWithPrefix(prefix string) Logger\n\tWithPrefixf(format string, args ...interface{}) Logger\n\tWithField(key string, value interface{}) Logger\n\tWithError(error error) Logger\n\tWithFields(fields map[string]interface{}) Logger\n\t//\n\tDebug(args ...interface{})\n\tDebugf(format string, args ...interface{})\n\tInfo(args ...interface{})\n\tInfof(format string, args ...interface{})\n\tWarn(args ...interface{})\n\tWarnf(format string, args ...interface{})\n\tError(args ...interface{})\n\tErrorf(format string, args ...interface{})\n\t//\n\tPrint(args ...interface{})\n\tPrintf(format string, args ...interface{})\n\tPrintln(args ...interface{})\n\tFatal(args ...interface{})\n\tFatalf(format string, args ...interface{})\n\tFatalln(args ...interface{})\n\tPanic(args ...interface{})\n\tPanicf(format string, args ...interface{})\n\tPanicln(args ...interface{})\n}\n```\n\n\n## Backends\n\n- [Logrus](https://github.com/sirupsen/logrus) with `logger.WrapLogrus(l *logrus.Logger)` function\n- [slog](https://pkg.go.dev/log/slog) with `logger.WrapSlog(l *slog.Logger)` function\n  - [slog_gelf_handler.go](https://github.com/mdouchement/logger/blob/master/slog_gelf_handler.go) can be used independently\n  - [slog_text_handler.go](https://github.com/mdouchement/logger/blob/master/slog_text_handler.go) (logrus format) can be used independently\n\n\n## Helpers\n\n- `type M map[string]interface{}` used as a shorthand for a map of interfaces used by `WithFields` method\n- `func WithLogger(ctx context.Context, l Logger) context.Context` to embeds the logger inside a context\n- `func LogWith(ctx context.Context) Logger` to extract a logger from a context\n\n## License\n\n**MIT**\n\n\n## Contributing\n\nAll PRs are welcome.\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n5. Push to the branch (git push origin my-new-feature)\n6. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdouchement%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdouchement%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdouchement%2Flogger/lists"}