{"id":15817306,"url":"https://github.com/nikoksr/onelog","last_synced_at":"2026-01-14T13:16:06.187Z","repository":{"id":182904861,"uuid":"669301090","full_name":"nikoksr/onelog","owner":"nikoksr","description":"A unified logging interface for Go.","archived":true,"fork":false,"pushed_at":"2023-07-26T08:58:24.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-05T05:41:10.654Z","etag":null,"topics":["go","golang","hacktoberfest","logger-interface","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/nikoksr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-21T21:26:53.000Z","updated_at":"2024-08-01T18:57:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"5536aade-18b2-4ac2-b361-cde3143d302f","html_url":"https://github.com/nikoksr/onelog","commit_stats":null,"previous_names":["nikoksr/onelog"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/nikoksr/onelog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fonelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fonelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fonelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fonelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikoksr","download_url":"https://codeload.github.com/nikoksr/onelog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fonelog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","golang","hacktoberfest","logger-interface","logging"],"created_at":"2024-10-05T05:40:50.646Z","updated_at":"2026-01-14T13:16:06.169Z","avatar_url":"https://github.com/nikoksr.png","language":"Go","readme":"\u003cdiv align=\"center\"\u003e\n\n\u0026nbsp;\n\u003ch1\u003eonelog\u003c/h1\u003e\n\u003cp\u003e\u003ci\u003eA unified logging interface for Go. The library is currently still a work in progress.\u003c/i\u003e\u003c/p\u003e\n\n\u0026nbsp;\n\n[![codecov](https://codecov.io/gh/nikoksr/onelog/branch/main/graph/badge.svg?token=oVqojUn7pd)](https://codecov.io/gh/nikoksr/onelog)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nikoksr/onelog)](https://goreportcard.com/report/github.com/nikoksr/onelog)\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat)](https://pkg.go.dev/github.com/nikoksr/onelog)\n\u003c/div\u003e\n\n\u0026nbsp;\n## About \u003ca id=\"about\"\u003e\u003c/a\u003e\n\n\u003e This is a work in progress.\n\n_onelog_ is a general-purpose logging interface heavily inspired by the [zerolog](https://github.com/rs/zerolog) API. It is designed to provide a user-friendly API for diverse logging requirements. This package supports a wide range of data types and log levels, creating flexibility for various use cases.\n\n_onelog_ includes adapters for several commonly used loggers, enabling easy integration and compatibility with existing logging methodologies. It reduces the friction associated with logging setup and promotes consistency in logging across different parts of a project or across different projects.\n\nPersonally, I plan on using this library in my projects [Notify](https://github.com/nikoksr/notify) and [doppler-go](https://github.com/nikoksr/doppler-go), to provide the users of both projects with a unified logging interface without having to force them to use a specific logging library.\n\n## Install \u003ca id=\"install\"\u003e\u003c/a\u003e\n\n```sh\ngo get -u github.com/nikoksr/onelog\n```\n\n## Example usage \u003ca id=\"usage\"\u003e\u003c/a\u003e\n\n```go\nfunc main() {\n\n    // Let's use zap's production logger as our superhero event logger\n    logger, _ := zap.NewProduction()\n\n\t// Use the zapadapter to create a onelog.Logger compatible logger\n    superheroTracker := zapadapter.NewAdapter(logger)\n\n\t// Start logging\n    superheroTracker.Debug().Msg(\"Tracking superheroes...\")\n\n    // Now let's log a superhero event\n    superheroTracker.Info().\n        Str(\"superhero\", \"Superman\").\n        Str(\"location\", \"New York\").\n        Time(\"time\", time.Now()).\n        Msg(\"Superman seen flying over New York!\")\n\n    // Or perhaps we'd rather use slog for logging our superhero sightings\n    superheroTracker = slogadapter.NewAdapter(slog.Default())\n\n    // And now we can log another sighting\n    superheroTracker.Info().\n        Str(\"superhero\", \"Batman\").\n        Str(\"location\", \"Gotham\").\n        Time(\"time\", time.Now()).\n        Msg(\"Batman seen driving through Gotham!\")\n\n    // Output:\n    // {\"level\":\"info\",\"ts\":1690213152.0569847,\"caller\":\"zap/adapter.go:547\",\"msg\":\"Superman seen flying over New York!\",\"superhero\":\"Superman\",\"location\":\"New York\",\"time\":1690213152.0569835}\n    // 2023/07/24 17:39:12 INFO Batman seen driving through Gotham! superhero=Batman location=Gotham time=2023-07-24T17:39:12.057+02:00\n    //\n    // Note: The lines above look differently because we switched the logger in between.\n}\n```\n\nFor more examples, please take a look at the [examples](_examples) directory.\n\n## Contributing \u003ca id=\"contributing\"\u003e\u003c/a\u003e\n\nContributions of all kinds are very welcome! Feel free to check\nour [open issues](https://github.com/nikoksr/onelog/issues). Please also take a look at\nthe [contribution guidelines](https://github.com/nikoksr/onelog/blob/main/CONTRIBUTING.md).\n\n## Show your support \u003ca id=\"support\"\u003e\u003c/a\u003e\n\nPlease give a ⭐️ if you like this project! This helps us to get more visibility and helps other people to find this\nproject.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoksr%2Fonelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikoksr%2Fonelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoksr%2Fonelog/lists"}