{"id":37163009,"url":"https://github.com/mandala/go-log","last_synced_at":"2026-01-14T19:23:41.827Z","repository":{"id":57487828,"uuid":"82568738","full_name":"Mandala/go-log","owner":"Mandala","description":"Colorful and simple logging library for Golang","archived":false,"fork":false,"pushed_at":"2022-12-27T20:08:02.000Z","size":11,"stargazers_count":40,"open_issues_count":5,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-16T02:47:07.475Z","etag":null,"topics":["color","golang","golang-library","logging","terminal"],"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/Mandala.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}},"created_at":"2017-02-20T14:47:13.000Z","updated_at":"2024-12-25T05:34:22.000Z","dependencies_parsed_at":"2023-01-31T05:16:03.061Z","dependency_job_id":null,"html_url":"https://github.com/Mandala/go-log","commit_stats":null,"previous_names":["withmandala/go-log"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Mandala/go-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandala%2Fgo-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandala%2Fgo-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandala%2Fgo-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandala%2Fgo-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mandala","download_url":"https://codeload.github.com/Mandala/go-log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mandala%2Fgo-log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432587,"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":["color","golang","golang-library","logging","terminal"],"created_at":"2026-01-14T19:23:41.087Z","updated_at":"2026-01-14T19:23:41.819Z","avatar_url":"https://github.com/Mandala.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Golang Logging Library\n=======================\n\nThe colorful and simple logging library for Golang.\n\n## What is this\n\nOpinionated logging library that able to output to `io.Reader` with file descriptors (`os.Stdout`, `os.Stderr`,\nregular file, etc.) with automatic terminal color support.\n\nThe log serverity and behavior can be described as follows:\n\n| Severity | Description | Caller Info |\n|:--------:|:------------|:-----------:|\n| Fatal | Unrecoverable error and automatically exit after logging | Yes |\n| Error | Recoverable error but need attention | Yes |\n| Warn | Minor error and does not output the caller info | No |\n| Info | Informational message | No |\n| Debug | Debug message, only shown when debug enabled | Yes |\n| Trace | Trace message, only shown when debug enabled | No |\n\n## Getting started\n\nAdd the `go-log` package using\n\n```\ngo get github.com/withmandala/go-log\n```\n\nAnd import it to your package by\n\n```go\nimport (\n    \"github.com/withmandala/go-log\"\n)\n```\n\nUse the `go-log` package with\n\n```go\nlogger := log.New(os.Stderr)\nlogger.Info(\"Hi, this is your logger\")\n```\n\nWrite to a `log` file\n```go\nf, err := os.Create(\"app.log\")\nif err != nil {\n\tfmt.Println(err)\n\treturn\n}\nlogger := log.New(f)\n```\n## Color support\n\nThe library will try to automatically detect the `io.Reader` file descriptor when calling `log.New()` for color\nsupport. But, if you insist to use or not to use color, you can add `.WithColor()` or `.WithoutColor()` respectively.\n\n```go\n// With color\nlogger := log.New(os.Stderr).WithColor()\n\n// Without color\nlogger := log.New(os.Stderr).WithoutColor()\n```\n\n## Debug output\n\nThe log library will suppress the `.Debug()` and `.Trace()` output by default. To enable or disable the debug output,\ncall `(Logger).WithDebug()` or `(Logger).WithoutDebug()` respectively.\n\n```go\n// Enable debugging\nlogger := log.New(os.Stderr).WithDebug()\n// Print debug output\nlogger.Debug(\"Test debug output\")\n// Disable debug output\nlogger.WithoutDebug()\nlogger.Debug(\"Test debug output\") // This message will not be printed\n```\n\n## Be Quiet\n\nIf somehow the log is annoying to you, just shush it by calling `(Logger).Quiet()` and **ALL** log output will be\ndisappear, although `.Fatal()` will silently quit the program with error. To re-enable the log output use\n`(Logger).NoQuiet()`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandala%2Fgo-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandala%2Fgo-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandala%2Fgo-log/lists"}