{"id":20171931,"url":"https://github.com/harwoeck/liblog","last_synced_at":"2026-06-06T04:31:47.590Z","repository":{"id":57616636,"uuid":"384441383","full_name":"harwoeck/liblog","owner":"harwoeck","description":"Discontinued in favor of log/slog. liblog was an interface/contract for logging backends. It was used by public libraries and packages that wanted to give their user's control over structured and leveled logging output.","archived":false,"fork":false,"pushed_at":"2024-02-05T17:08:59.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T15:49:21.867Z","etag":null,"topics":["apache2","apache2-license","go","golang","libraries","library","log","logging","package","packages","user-control"],"latest_commit_sha":null,"homepage":"https://harwoeck.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harwoeck.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}},"created_at":"2021-07-09T13:12:20.000Z","updated_at":"2024-02-05T17:06:26.000Z","dependencies_parsed_at":"2024-11-14T01:30:24.752Z","dependency_job_id":"793c1af6-09e6-4638-9860-869e03d80a39","html_url":"https://github.com/harwoeck/liblog","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harwoeck%2Fliblog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harwoeck%2Fliblog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harwoeck%2Fliblog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harwoeck%2Fliblog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harwoeck","download_url":"https://codeload.github.com/harwoeck/liblog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241607588,"owners_count":19989922,"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":["apache2","apache2-license","go","golang","libraries","library","log","logging","package","packages","user-control"],"created_at":"2024-11-14T01:28:26.863Z","updated_at":"2026-06-06T04:31:47.524Z","avatar_url":"https://github.com/harwoeck.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# liblog\n\n\u003e [!CAUTION]\n\u003e **DISCONTINUED in favor of [log/slog](https://go.dev/blog/slog)**\n\n*liblog* was an interface/contract for logging backends. It was used by public libraries and packages that wanted to give their user's control over structured and leveled logging output.\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/harwoeck/liblog.svg)](https://pkg.go.dev/github.com/harwoeck/liblog)\n\n### Advantages\n\n- 🟢 Users can provide their own logging stack __**and**__ get detailed package-level logging\n- 🟢 *liblog* provides implementations for well-known logging backends (see `/impl`)\n\n### Getting started\n\n- `go get github.com/harwoeck/liblog` - provides the *liblog* interface, and an implementation that only relies on Go's\n  standard library\n- Use `liblog.NewStd(...StdOption)` by default inside your package, but give users the option to specify their own\n  logging implementation (`liblog.Logger`)\n\n### Usage\n\n- Extensively use all provided options, like `Named()`, `With()` and appropriate logging levels, to provide the best log\n  results/experience.\n- Use `field()` (or `liblog.NewField()`) to generate structured elements for your logs (see Tips #1)\n\n### Tips\n\n1. Create a file `logfield.go` and add this `fieldImpl`. You can now use `field()` instead of the\n   longer `liblog.NewField()` inside your package to create structured logging elements\n    ```go\n    type fieldImpl struct {\n        key   string\n        value interface{}\n    }\n    \n    func (f *fieldImpl) Key() string        { return f.key }\n    func (f *fieldImpl) Value() interface{} { return f.value }\n    \n    func field(key string, value interface{}) contract.Field {\n        return \u0026fieldImpl{\n            key:   key,\n            value: value,\n        }\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharwoeck%2Fliblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharwoeck%2Fliblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharwoeck%2Fliblog/lists"}