{"id":37175306,"url":"https://github.com/baobabus/slog","last_synced_at":"2026-01-14T20:28:20.941Z","repository":{"id":57579440,"uuid":"52012142","full_name":"baobabus/slog","owner":"baobabus","description":"Structured logging for go.","archived":false,"fork":false,"pushed_at":"2020-08-19T23:02:43.000Z","size":1211,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T22:22:50.770Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baobabus.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}},"created_at":"2016-02-18T14:15:47.000Z","updated_at":"2016-02-22T16:06:02.000Z","dependencies_parsed_at":"2022-09-26T19:12:11.788Z","dependency_job_id":null,"html_url":"https://github.com/baobabus/slog","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/baobabus/slog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baobabus%2Fslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baobabus%2Fslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baobabus%2Fslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baobabus%2Fslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baobabus","download_url":"https://codeload.github.com/baobabus/slog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baobabus%2Fslog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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-14T20:28:20.163Z","updated_at":"2026-01-14T20:28:20.930Z","avatar_url":"https://github.com/baobabus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slog\nStructured logging for go.\n\n[![Build Status (Linux)](https://travis-ci.org/baobabus/slog.svg?branch=master)](https://travis-ci.org/baobabus/slog)\n\n# Usage\n\nExample logging with global logger:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"github.com/baobabus/slog\"\n\t\"time\"\n)\n\nfunc emit(i int) error {\n\tif i % 2 == 0 {\n\t\treturn errors.New(\"Bad input\")\n\t}\n\treturn nil\n}\n\nfunc main () {\n\tslog.Info().Prints(\"Starting conditional\", \"time\", time.Now())\n\tfor i := 0; i \u003c 4; i++ {\n\t\terr := emit(i)\n\t\tslog.On(err).Prints(\"Problem with emit():\", \"i\", i)\n\t}\n\tslog.Info().Prints(\"Finished conditional\", \"time\", time.Now())\n\tslog.Info().Prints(\"Starting unconditional\", \"time\", time.Now())\n\tfor i := 0; i \u003c 4; i++ {\n\t\terr := emit(i)\n\t\tslog.With(err).Prints(\"Returned from emit():\", \"i\", i)\n\t}\n\tslog.Info().Prints(\"Finished unconditional\", \"time\", time.Now())\n}\n```\n\nOutput:\n```\nINFO 2016/07/20 11:23:58 Starting conditional time=2016-07-20T11:23:58-05:00\nERROR 2016/07/20 11:23:58 Problem with emit(): i=0 - error=Bad input\nERROR 2016/07/20 11:23:58 Problem with emit(): i=2 - error=Bad input\nINFO 2016/07/20 11:23:58 Finished conditional time=2016-07-20T11:23:58-05:00\nINFO 2016/07/20 11:23:58 Starting unconditional time=2016-07-20T11:23:58-05:00\nERROR 2016/07/20 11:23:58 Returned from emit(): i=0 - error=Bad input\nNOTICE 2016/07/20 11:23:58 Returned from emit(): i=1 - success\nERROR 2016/07/20 11:23:58 Returned from emit(): i=2 - error=Bad input\nNOTICE 2016/07/20 11:23:58 Returned from emit(): i=3 - success\nINFO 2016/07/20 11:23:58 Finished unconditional time=2016-07-20T11:23:58-05:00\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaobabus%2Fslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaobabus%2Fslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaobabus%2Fslog/lists"}