{"id":22123923,"url":"https://github.com/nownabe/clog","last_synced_at":"2025-07-25T15:31:43.598Z","repository":{"id":195550413,"uuid":"691546467","full_name":"nownabe/clog","owner":"nownabe","description":"clog is a structured logger optimized for Cloud Logging based on log/slog.","archived":false,"fork":false,"pushed_at":"2024-11-19T22:10:47.000Z","size":97,"stargazers_count":5,"open_issues_count":8,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-19T23:23:22.759Z","etag":null,"topics":["cloud-logging","gcp","go","golang","google-cloud","logger","logging"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/go.nownabe.dev/clog","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/nownabe.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-09-14T11:59:27.000Z","updated_at":"2024-11-02T06:25:01.000Z","dependencies_parsed_at":"2023-09-18T17:44:39.654Z","dependency_job_id":"1bdca14e-1bd9-4d6a-baa2-60d984db9742","html_url":"https://github.com/nownabe/clog","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":"0.18367346938775508","last_synced_commit":"2b41f94b77164224a904aae1e6c3f2eaf794f85c"},"previous_names":["nownabe/clog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nownabe%2Fclog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nownabe%2Fclog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nownabe%2Fclog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nownabe%2Fclog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nownabe","download_url":"https://codeload.github.com/nownabe/clog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227590148,"owners_count":17790446,"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":["cloud-logging","gcp","go","golang","google-cloud","logger","logging"],"created_at":"2024-12-01T15:45:26.606Z","updated_at":"2024-12-01T15:45:27.042Z","avatar_url":"https://github.com/nownabe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go.nownabe.dev/clog\n\n[![PkgGoDev](https://pkg.go.dev/badge/go.nownabe.dev/clog)](https://pkg.go.dev/go.nownabe.dev/clog)\n[![License](https://img.shields.io/github/license/nownabe/clog.svg?style=popout)](https://github.com/nownabe/clog/blob/main/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nownabe/clog)](https://goreportcard.com/report/github.com/nownabe/clog)\n[![codecov](https://codecov.io/gh/nownabe/clog/graph/badge.svg?token=hbX8ZaXRRC)](https://codecov.io/gh/nownabe/clog)\n\nclog is a structured logger optimized for [Cloud Logging] based on [log/slog](https://pkg.go.dev/log/slog).\n\nclog supports following special fields in JSON log entries:\n\n- `severity`\n- `message`\n- `httpRequest`\n- `time`\n- `logging.googleapis.com/insertId`\n- `logging.googleapis.com/labels`\n- `logging.googleapis.com/operation`\n- `logging.googleapis.com/sourceLocation`\n- `logging.googleapis.com/spanId`\n- `logging.googleapis.com/trace`\n- `logging.googleapis.com/trace_sampled`\n- `logging.googleapis.com/stack_trace`\n\nSee [Cloud Logging documentation] and [Cloud Error Reporting documentation] for more details.\n\n## Severity\n\nclog uses Severity in the `severity` field instead of log levels. 8 severities are supported:\n\n- DEBUG\n- INFO\n- NOTICE\n- WARNING\n- ERROR\n- CRITICAL\n- ALERT\n- EMERGENCY\n\n## Usage\n\nEach severity has three methods like Info, Infof, and InfoErr.\n\n```go\nclog.Info(ctx, \"simple logging with args\", \"key\", \"value\")\n// {\"severity\":\"INFO\", \"message\":\"simple logging with args\", \"key\":\"value\",\n//  \"time\": \"...\", \"logging.googleapis.com/sourceLocation\": {...}}\n\nclog.Noticef(ctx, \"formatted message %s %s\", \"like\", \"fmt.Printf\")\n// {\"severity\":\"NOTICE\", \"message\":\"formatted message like fmt.Printf\",\n//  \"time\": \"...\", \"logging.googleapis.com/sourceLocation\": {...}}\n\nclog.CriticalErr(ctx, errors.New(\"critical error!!\"), \"key\", \"value\")\n// {\"severity\":\"CRITICAL\", \"message\":\"critical error!!\", \"key\":\"value\",\n//  \"time\": \"...\", \"logging.googleapis.com/sourceLocation\": {...}}\n\n// clog.ErrorErr has a shorthand clog.Err.\nclog.Err(ctx, errors.New(\"error!\"))\n// {\"severity\":\"ERROR\", \"message\":\"error!\",\n//  \"time\": \"...\", \"logging.googleapis.com/sourceLocation\": {...}}\n```\n\nSee [Examples](https://pkg.go.dev/go.nownabe.dev/clog#pkg-examples) for more details.\n\n[Cloud Logging]: https://cloud.google.com/logging\n[Cloud Logging documentation]: https://cloud.google.com/logging/docs/structured-logging\n[Cloud Error Reporting documentation]: https://cloud.google.com/error-reporting/docs/formatting-error-messages\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnownabe%2Fclog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnownabe%2Fclog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnownabe%2Fclog/lists"}