{"id":20557004,"url":"https://github.com/sharpvik/log-go","last_synced_at":"2026-06-10T09:31:47.908Z","repository":{"id":57561491,"uuid":"328785422","full_name":"sharpvik/log-go","owner":"sharpvik","description":"Minimalistic thread-safe logging library for Go","archived":false,"fork":false,"pushed_at":"2022-02-01T01:09:20.000Z","size":119,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T06:48:32.417Z","etag":null,"topics":["concurrent","go","golang","loggers","logging","thread-safe","threading"],"latest_commit_sha":null,"homepage":"","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/sharpvik.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":"2021-01-11T20:37:55.000Z","updated_at":"2022-02-01T01:07:46.000Z","dependencies_parsed_at":"2022-09-10T08:11:35.736Z","dependency_job_id":null,"html_url":"https://github.com/sharpvik/log-go","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sharpvik/log-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Flog-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Flog-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Flog-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Flog-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharpvik","download_url":"https://codeload.github.com/sharpvik/log-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharpvik%2Flog-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34146871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["concurrent","go","golang","loggers","logging","thread-safe","threading"],"created_at":"2024-11-16T03:34:16.095Z","updated_at":"2026-06-10T09:31:47.848Z","avatar_url":"https://github.com/sharpvik.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# log-go\n\nLog-go is a logging library developed with simplicity and thread-safety in mind.\nIt doesn't support any extra-fancy features. Just like Go itself.\n\nIf you wish to improve upon this, you are welcome to send me a Pull Request.\n\n\u003cp style=\"text-align: center; line-height: 0; padding: 30px 0 0;\"\u003e\n\t\u003ca href=\"examples/colors/main.go\"\u003eExample with Colors\u003c/a\u003e\n\u003c/p\u003e\n\n![Demo](media/konsole.png)\n\n## Features\n\n- Different log levels like **Fatal**, **Error**, **Info**, etc.\n- Configurable _buffered_ writer (`os.Stdout`, `*File`, etc.)\n- Thread safety\n- Prefixes to separate logs from everything else\n- Extremely simple setup\n- Optionally coloured terminal output\n- Well-tested\n\n## Log Levels\n\nThis library comes with the following log levels:\n\n1. Panic\n2. Fatal\n3. Error\n4. Warn\n5. Info\n6. Debug\n\nThese are enumerated as `LevelDebug`, `LevelInfo`, etc., so that you won't have\nto memorise them by numbers.\n\nEach `Log` instance has five methods that are named precisely after the levels.\nAs well as their formatted counterparts `Debugf`, `Infof`, `Errorf`, etc.\nUse them like so:\n\n```go\nlogger := log.Default()\nlogger.Warn(\"this is a warning\")\nlogger.Infof(\"this is an information message #%d\", 42)\n```\n\n## [Basic Setup](examples/basic/main.go)\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"github.com/sharpvik/log-go\"\n)\n\nfunc init() {\n\t// Change log level.\n\tlog.SetLevel(log.LevelInfo) // default: LevelError\n\n\t// Change log writer.\n\tfile, _ := os.Create(\"server.log\")\n\tlog.SetWriter(file) // default: os.Stdout\n}\n\nfunc main() {\n\t// Computations ...\n\tx := 40 + 2\n\n\t// Print log with priority level Info.\n\tlog.Infof(\"x = %d\", x)\n\t// * 11/01/2021 23:07:08 INFO  x = 42\n}\n```\n\n## Examples\n\nYou are welcome to look at some [examples](examples) too!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpvik%2Flog-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharpvik%2Flog-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharpvik%2Flog-go/lists"}