{"id":28277332,"url":"https://github.com/sam701/slog","last_synced_at":"2025-06-13T06:04:24.460Z","repository":{"id":291429364,"uuid":"977596128","full_name":"sam701/slog","owner":"sam701","description":"Structured logging for Zig","archived":false,"fork":false,"pushed_at":"2025-06-04T20:40:27.000Z","size":146,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T02:19:31.995Z","etag":null,"topics":["logging","zig-package","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/sam701.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,"zenodo":null}},"created_at":"2025-05-04T15:10:58.000Z","updated_at":"2025-06-04T20:40:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8ec7bb1-4264-44cd-a679-59c2e67c7e2a","html_url":"https://github.com/sam701/slog","commit_stats":null,"previous_names":["sam701/slog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sam701/slog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam701%2Fslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam701%2Fslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam701%2Fslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam701%2Fslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sam701","download_url":"https://codeload.github.com/sam701/slog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam701%2Fslog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259592258,"owners_count":22881265,"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":["logging","zig-package","ziglang"],"created_at":"2025-05-21T06:15:43.344Z","updated_at":"2025-06-13T06:04:24.449Z","avatar_url":"https://github.com/sam701.png","language":"Zig","readme":"# Structured Logging for Zig\n[![Zig Docs](https://img.shields.io/badge/docs-zig-%23f7a41d)](https://sam701.github.io/slog)\n\n`slog` is a configurable, structured logging package for Zig with support for hierarchical loggers.\n![img](./doc/log-output.png)\n\n## Usage\nAdd `slog` to your `build.zig.zon`\n```\nzig fetch --save git+https://github.com/sam701/slog\n```\n\nExample code:\n```zig\nconst std = @import(\"std\");\nconst slog = @import(\"slog\");\n\npub fn main() !void {\n    var log = try slog.initRootLogger(std.heap.page_allocator, .{});\n    defer log.deinit();\n\n    var log2 = try log.initChildLogger(\"mod1\");\n    var log3 = try log2.initChildLogger(\"mod2\");\n    var log4 = try log3.initChildLogger(\"mod3\");\n\n    log.info(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value1\", .rate = 30 });\n    log2.trace(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value2\", .rate = 30 });\n    log2.debug(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value3\", .rate = 30 });\n    log2.info(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value4\", .rate = 30e2 });\n    log3.warn(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value5\", .rate = 30.34534 });\n    log3.err(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value6\", .rate = 30, .active = true, .metadata = null });\n    log4.err(\"Hello slog!\", .{ .field1 = \"value1\", .field2 = \"value6\", .rate = 30, .active = true, .metadata = null });\n}\n```\n\n\n## Environment Variables\n* `ZIG_LOG` - configures log level, e.g. `info,mod1=debug,mod2.mod3=warn`.\n* `ZIG_LOG_COLORS` - configures color scheme for text logger, e.g. `timestamp=31;1,logger=33`.\n\n## Dependencies\n* [zeit](https://github.com/rockorager/zeit?tab=readme-ov-file) - a great date and time library for Zig\n","funding_links":[],"categories":["Language Essentials"],"sub_categories":["Logging Processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam701%2Fslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsam701%2Fslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam701%2Fslog/lists"}