{"id":40695292,"url":"https://github.com/deviantony/drillog","last_synced_at":"2026-01-21T11:35:12.420Z","repository":{"id":327725886,"uuid":"1110463566","full_name":"deviantony/drillog","owner":"deviantony","description":"Hierarchical logging for Go","archived":false,"fork":false,"pushed_at":"2025-12-06T15:27:13.000Z","size":68,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-08T19:56:36.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deviantony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-05T08:26:10.000Z","updated_at":"2025-12-05T10:22:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deviantony/drillog","commit_stats":null,"previous_names":["deviantony/drillog"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/deviantony/drillog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deviantony%2Fdrillog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deviantony%2Fdrillog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deviantony%2Fdrillog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deviantony%2Fdrillog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deviantony","download_url":"https://codeload.github.com/deviantony/drillog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deviantony%2Fdrillog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-21T11:35:11.781Z","updated_at":"2026-01-21T11:35:12.403Z","avatar_url":"https://github.com/deviantony.png","language":"Go","readme":"# drillog\n\nHierarchical logging for Go. Flat files, tree views.\n\n## The Problem\n\nModern apps generate thousands of log lines. Concurrent operations interleave. Finding one request's journey through grep is painful.\n\n## The Solution\n\nKeep logs flat (greppable), but add minimal metadata. A viewer reconstructs the hierarchy on demand.\n\n```\nYour App  →  Flat Log File  →  Tree Viewer\n              (still works      (see the\n               with grep)        hierarchy)\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"os\"\n\n    \"github.com/deviantony/drillog\"\n)\n\nfunc main() {\n    drillog.SetDefault(drillog.NewTextHandler(os.Stderr, nil))\n\n    ctx := context.Background()\n    ctx, end := drillog.Start(ctx, \"main\")\n    defer end()\n\n    drillog.Info(ctx, \"starting\")\n    processOrder(ctx, 12345)\n}\n\nfunc processOrder(ctx context.Context, orderID int) {\n    ctx, end := drillog.Start(ctx, \"processOrder\")\n    defer end()\n\n    drillog.Info(ctx, \"loading order\", \"order_id\", orderID)\n}\n```\n\n**Output:**\n```\n2025-12-04T10:00:00Z INFO main started span=a1b2c3d4\n2025-12-04T10:00:00Z INFO starting span=a1b2c3d4\n2025-12-04T10:00:00Z INFO processOrder started span=e5f6a7b8 parent=a1b2c3d4\n2025-12-04T10:00:00Z INFO loading order order_id=12345 span=e5f6a7b8 parent=a1b2c3d4\n2025-12-04T10:00:00Z INFO processOrder completed duration=1.2ms span=e5f6a7b8 parent=a1b2c3d4\n2025-12-04T10:00:00Z INFO main completed duration=2.5ms span=a1b2c3d4\n```\n\n**In the viewer:**\n```\n▼ main [2.5ms]\n  │ starting\n  ▼ processOrder [1.2ms]\n    │ loading order order_id=12345\n```\n\n## Installation\n\n```bash\ngo get github.com/deviantony/drillog\n```\n\n## API\n\n### Starting Spans\n\n```go\nctx, end := drillog.Start(ctx, \"operation name\")\ndefer end()\n```\n\nNested calls automatically capture parent relationships.\n\n### Logging\n\n```go\ndrillog.Debug(ctx, \"message\", \"key\", \"value\")\ndrillog.Info(ctx, \"message\", \"key\", \"value\")\ndrillog.Warn(ctx, \"message\", \"key\", \"value\")\ndrillog.Error(ctx, \"message\", \"key\", \"value\")\n```\n\nOr use standard slog (if handler is configured):\n\n```go\nslog.InfoContext(ctx, \"message\", \"key\", \"value\")\n```\n\n### Configuration\n\n```go\n// Text output (human-readable)\ndrillog.SetDefault(drillog.NewTextHandler(os.Stderr, nil))\n\n// JSON output\ndrillog.SetDefault(drillog.NewJSONHandler(os.Stderr, nil))\n\n// Wrap existing handler\ndrillog.SetDefault(drillog.NewHandler(myHandler, nil))\n\n// Custom ID generator\ndrillog.SetDefault(drillog.NewTextHandler(os.Stderr, \u0026drillog.HandlerOptions{\n    IDGenerator: myIDFunc,\n}))\n```\n\n### Context Utilities\n\n```go\nspanID := drillog.SpanID(ctx)     // current span ID\nparentID := drillog.ParentID(ctx) // parent span ID\n```\n\n## Design Principles\n\n- **Zero config works** - defaults to `slog.Default()`\n- **Context-first** - no logger objects to pass around\n- **Standard library only** - no external dependencies\n- **Logs stay flat** - works with grep, tail, existing tools\n- **Minimal API** - `Start()` + `defer end()` + log functions\n\n## Viewer\n\nOpen `viewer.html` in any browser. Drag and drop your log file. See the tree.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeviantony%2Fdrillog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeviantony%2Fdrillog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeviantony%2Fdrillog/lists"}