{"id":17882351,"url":"https://github.com/mgjules/logem","last_synced_at":"2025-09-01T10:03:37.003Z","repository":{"id":81889981,"uuid":"606076473","full_name":"mgjules/logem","owner":"mgjules","description":"A simple slog handler wrapper which adds level handling and tracing ability.","archived":false,"fork":false,"pushed_at":"2023-02-27T10:44:58.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T02:13:24.772Z","etag":null,"topics":["go","golang","logging-library","slog"],"latest_commit_sha":null,"homepage":"","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/mgjules.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":"2023-02-24T14:46:43.000Z","updated_at":"2024-03-10T00:46:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"fcceb6d4-4ffb-4a75-85b2-2017b9aa13ce","html_url":"https://github.com/mgjules/logem","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mgjules/logem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgjules%2Flogem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgjules%2Flogem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgjules%2Flogem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgjules%2Flogem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgjules","download_url":"https://codeload.github.com/mgjules/logem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgjules%2Flogem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273105948,"owners_count":25046950,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"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":["go","golang","logging-library","slog"],"created_at":"2024-10-28T12:52:01.544Z","updated_at":"2025-09-01T10:03:36.966Z","avatar_url":"https://github.com/mgjules.png","language":"Go","readme":"# Logem\n\n[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge)](https://godoc.org/github.com/mgjules/logem)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](LICENSE)\n\nLogem, short for \"Let's Log em!\", is an opinionated handler wrapper for [slog](https://pkg.go.dev/golang.org/x/exp/slog).\n\nIt combines a LevelHandler and a TraceHandler in a single, simple to use handler.\n\n## Disclaimer\n\nThis package is not suited for production use right now. It is heavily being worked on.\n\nHowever feel free to inspire yourself from it or fork it.\n\n## Installation\n\n```shell\ngo get -u github.com/mgjules/logem\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"os\"\n\n  \"github.com/mgjules/logem\"\n  \"golang.org/x/exp/slog\"\n)\n\nfunc main() {\n  // Init OTEL trace provider.\n  // initTraceProvider()\n\n  // Create logger using logem.Handler.\n  logger := slog.New(\n    logem.NewHandler(\n      slog.NewTextHandler(os.Stdout),\n      logem.WithMinLevel(slog.LevelInfo),\n      logem.WithStackTrace(true),\n      logem.WithTraceID(true),\n      logem.WithSpanID(true),\n    ),\n  )\n  slog.SetDefault(logger)\n\n  // Use logger to log messages, etc.\n  // Please ensure that the context being passed has proper trace information.\n  ctx := context.TODO()\n  logger.WithContext(ctx).Info(\"hello\", \"count\", 3)\n}\n```\n\n## Stability\n\nThis project follows [SemVer](http://semver.org/) strictly and is not yet `v1`.\n\nBreaking changes might be introduced until `v1` is released.\n\nThis project follows the [Go Release Policy](https://golang.org/doc/devel/release.html#policy). Each major version of Go is supported until there are two newer major releases.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgjules%2Flogem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgjules%2Flogem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgjules%2Flogem/lists"}