{"id":24856692,"url":"https://github.com/secondtruth/go-logger","last_synced_at":"2025-03-26T15:24:05.662Z","repository":{"id":216599767,"uuid":"741677069","full_name":"secondtruth/go-logger","owner":"secondtruth","description":"📖 Common interface for logging facilities in Go","archived":false,"fork":false,"pushed_at":"2024-01-18T23:04:52.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T20:48:00.250Z","etag":null,"topics":["interface","interoperability","logging"],"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/secondtruth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-10T22:06:39.000Z","updated_at":"2024-01-28T01:53:04.000Z","dependencies_parsed_at":"2024-01-11T06:22:54.731Z","dependency_job_id":"884f872a-183b-4c47-be63-b93130bdaf00","html_url":"https://github.com/secondtruth/go-logger","commit_stats":null,"previous_names":["secondtruth/go-logger"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secondtruth%2Fgo-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secondtruth","download_url":"https://codeload.github.com/secondtruth/go-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245679208,"owners_count":20654791,"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":["interface","interoperability","logging"],"created_at":"2025-01-31T16:45:43.174Z","updated_at":"2025-03-26T15:24:05.642Z","avatar_url":"https://github.com/secondtruth.png","language":"Go","readme":"# Go Logger interface with implementations\n\nThis library provides a common interface for logging in Go. It also provides an implementation of the interface for [slog](https://pkg.go.dev/log/slog),\nwhich is part of the standard library.\n\nComing soon in independent repositories: Implementations for two other popular log libraries: [Logrus](https://github.com/sirupsen/logrus)\nand [zap](https://github.com/uber-go/zap).\n\n## Why is this interface useful?\n\nWhen we create libraries in general we shouldn't be logging but at times we do have to log, debug what the library is doing or trace the log.\n\nWe cannot implement a library with one log library and expect other applications to use the same log library. Here is where this interface comes in.\nIt allows others to change the log library at any time without changing the code.\n\n## Installation\n\nTo install `go-logger`, use the following command:\n\n\tgo get -u github.com/secondtruth/go-logger\n\n## Quick Start\n\n### Example for [slog](https://pkg.go.dev/log/slog)\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"log/slog\"\n\n\t\"github.com/secondtruth/go-logger/logger\"\n)\n\nfunc main() {\n\tslogHandler := slog.NewJSONHandler(os.Stdout, \u0026slog.HandlerOptions{\n\t\tLevel: slog.LevelDebug,\n\t})\n\tslogLog := slog.New(slogHandler)\n\tlog, _ := logger.NewSlogLogger(slogLog)\n\t\n\tlog.WithFields(logger.Fields{\n\t\t\"foo\": \"bar\",\n\t}).Info(\"message\")\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondtruth%2Fgo-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecondtruth%2Fgo-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecondtruth%2Fgo-logger/lists"}