{"id":15660299,"url":"https://github.com/nikoksr/simplog","last_synced_at":"2026-01-14T19:45:03.532Z","repository":{"id":57518449,"uuid":"248085935","full_name":"nikoksr/simplog","owner":"nikoksr","description":"A simple and opinionated library that lets you set up and use zap quickly. ","archived":true,"fork":false,"pushed_at":"2022-10-29T10:52:18.000Z","size":117,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T03:32:48.638Z","etag":null,"topics":["go","golang","logger","logging","simple","uber-zap","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/nikoksr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2020-03-17T22:31:00.000Z","updated_at":"2024-07-30T12:40:09.000Z","dependencies_parsed_at":"2023-01-20T14:50:22.981Z","dependency_job_id":null,"html_url":"https://github.com/nikoksr/simplog","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/nikoksr/simplog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fsimplog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fsimplog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fsimplog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fsimplog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikoksr","download_url":"https://codeload.github.com/nikoksr/simplog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoksr%2Fsimplog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","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","logger","logging","simple","uber-zap","zap"],"created_at":"2024-10-03T13:20:57.928Z","updated_at":"2026-01-14T19:45:03.511Z","avatar_url":"https://github.com/nikoksr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg\n    width=40%\n    src=\"assets/gopher-bug.svg\"\n    alt=\"simplog logo\"\n/\u003e\n\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/nikoksr/simplog?color=success\u0026label=version\u0026sort=semver)\n[![codecov](https://codecov.io/gh/nikoksr/simplog/branch/main/graph/badge.svg?token=NY51VEB9GZ)](https://codecov.io/gh/nikoksr/simplog)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nikoksr/simplog)](https://goreportcard.com/report/github.com/nikoksr/simplog)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/2d2f6bfb58834346b790dd35657f1a33)](https://www.codacy.com/gh/nikoksr/simplog/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=nikoksr/simplog\u0026amp;utm_campaign=Badge_Grade)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c9295422ae29fb489503/maintainability)](https://codeclimate.com/github/nikoksr/simplog/maintainability)\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/simplog)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003eA simple and opinionated library that lets you set up and use \u003ca href=\"https://github.com/uber-go/zap\"\u003ezap\u003c/a\u003e quickly.\n\n\u003ch1\u003e\u003c/h1\u003e\n\n#### About\n\nSimplog is a small library that sets [zap](https://github.com/uber-go/zap) up in a way that is easy to use and provides\nsome additional features. Simplog is opinionated and tries to provide a good default configuration for most use cases.\nIf you need more features, you may use the resulting zap logger directly.\n\n#### Features\n\n- Client and server modes\n- Visualized log levels\n- Optional context-binding support\n- Easy to use\n\n#### Install \u003ca id=\"install\"\u003e\u003c/a\u003e\n\n```bash\ngo get -u github.com/nikoksr/simplog\n```\n\n\u0026nbsp;\n\n#### Example Code\n\n\u003e For more examples, see the [examples](examples) directory.\n\n```go\npackage main\n\nimport \"github.com/nikoksr/simplog\"\n\nfunc main() {\n  // Using the manual configuration; alternatively you can use NewClientLogger() or NewServerLogger().\n  logger := simplog.NewWithOptions(\u0026simplog.Options{\n    Debug:             false,\n    IsServer:          true,\n  })\n\n  // At this point, you're using a zap.SugaredLogger and can use it as you would normally do.\n  logger.Info(\"You're awesome!\")\n  logger.Warn(\"Coffee is almost empty!\")\n  logger.Error(\"Unable to operate, caffein levels too low.\")\n}\n```\n\n\u0026nbsp;\n\n#### Example Outputs\n\n##### Client \u0026 server mode in debug\n\n\u003e In debug mode, independent of the mode, the logger will print all messages greater-equal than the debug-level in a human readable format.\n\n```bash\n2022-10-23T14:25:15.537+0200\tINFO\tsimplog\ttest-simplog/main.go:12\tYou're awesome!\n2022-10-23T14:25:15.537+0200\tWARN\tsimplog\ttest-simplog/main.go:13\tCoffee is almost empty!\n2022-10-23T14:25:15.537+0200\tERROR\tsimplog\ttest-simplog/main.go:14\tUnable to operate, caffein levels too low.\n```\n\n\u0026nbsp;\n\n##### Client mode in production\n\n\u003e In production mode, the client logger will print all messages greater-equal than the info-level in a human readable format and replace the log level with a colored emoji.\n\u003e\n\u003e The symbols are configurable and can be set to any string.\n\n```bash\n💡 You're awesome!\n⚠️ Coffee is almost empty!\n🔥 Unable to operate, caffein levels too low.\n```\n\n\u0026nbsp;\n\n##### Server mode in production\n\n\u003e In production mode, the server logger will print all messages greater-equal than the info-level in a structured format.\n\n```bash\n{\"level\":\"info\",\"ts\":1666528089.4873903,\"logger\":\"simplog\",\"caller\":\"test-simplog/main.go:12\",\"msg\":\"You're awesome!\"}\n{\"level\":\"warn\",\"ts\":1666528089.4874253,\"logger\":\"simplog\",\"caller\":\"test-simplog/main.go:13\",\"msg\":\"Coffee is almost empty!\"}\n{\"level\":\"error\",\"ts\":1666528089.487434,\"logger\":\"simplog\",\"caller\":\"test-simplog/main.go:14\",\"msg\":\"Unable to operate, caffein levels too low.\"}\n```\n\n\u0026nbsp;\n\n#### Credits\n\n- Logo by the amazing [MariaLetta/free-gophers-pack](https://github.com/MariaLetta/free-gophers-pack)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoksr%2Fsimplog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikoksr%2Fsimplog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoksr%2Fsimplog/lists"}