{"id":26780491,"url":"https://github.com/kaihendry/slogd","last_synced_at":"2026-03-10T05:02:11.858Z","repository":{"id":65662199,"uuid":"596430914","full_name":"kaihendry/slogd","owner":"kaihendry","description":"Structured LOGging Duration","archived":false,"fork":false,"pushed_at":"2023-02-10T13:17:31.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T16:55:24.603Z","etag":null,"topics":["go","golang","slog","tracing"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/kaihendry/slogd","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/kaihendry.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-02T06:55:16.000Z","updated_at":"2023-12-27T22:22:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"caf81510-a8e4-41ed-b3c0-57a9df905ffb","html_url":"https://github.com/kaihendry/slogd","commit_stats":null,"previous_names":["kaihendry/gotrace"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Fslogd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Fslogd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Fslogd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaihendry%2Fslogd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaihendry","download_url":"https://codeload.github.com/kaihendry/slogd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249678881,"owners_count":21309839,"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":["go","golang","slog","tracing"],"created_at":"2025-03-29T07:16:53.500Z","updated_at":"2026-03-10T05:02:06.795Z","avatar_url":"https://github.com/kaihendry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slog duration\n\nNo need for heavyweight tracing tools like X-ray, Jaeger or Zipkin. \"slogd\"\nmeasures the time for a function to return an error object.\n\nInspired by @[tj](https://github.com/tj)'s [Apex logs's Trace function](https://pkg.go.dev/github.com/apex/log#Trace)\n\n- https://github.com/apex/log/blob/master/_examples/trace/trace.go\n- https://github.com/apex/log/blob/8da83152b5d6177b4bfe3d12810a5afd25355170/entry.go#L142-L158\n\n## [slogd example](https://github.com/kaihendry/slogfest)\n\nSample code:\n\n    slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout)))\n    url := \"https://httpbin.org/delay/2\"\n    var err error\n    // Caveat: Only one defer slogd per function!\n    defer slogd.New(\"fetching\", \"url\", url).Stop(\u0026err)\n    _, err = http.Get(url)\n\nSample output:\n\n    time=2023-02-10T20:21:46.564+08:00 level=INFO msg=fetching url=https://httpbin.org/delay/2 duration=3.716787544s\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaihendry%2Fslogd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaihendry%2Fslogd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaihendry%2Fslogd/lists"}