{"id":29192318,"url":"https://github.com/linuskmr/logo","last_synced_at":"2025-07-02T01:06:13.012Z","repository":{"id":57633305,"uuid":"298541405","full_name":"linuskmr/logo","owner":"linuskmr","description":"logo is a logger for go. It's an extension of the log package from the standard library","archived":false,"fork":false,"pushed_at":"2022-12-20T11:37:58.000Z","size":55,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-19T05:44:22.251Z","etag":null,"topics":["golang","logging"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/linuskmr/logo","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuskmr.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":"2020-09-25T10:28:41.000Z","updated_at":"2024-06-19T05:44:22.252Z","dependencies_parsed_at":"2023-01-30T00:30:57.493Z","dependency_job_id":null,"html_url":"https://github.com/linuskmr/logo","commit_stats":null,"previous_names":["linus-k519/logo"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/linuskmr/logo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuskmr%2Flogo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuskmr%2Flogo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuskmr%2Flogo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuskmr%2Flogo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuskmr","download_url":"https://codeload.github.com/linuskmr/logo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuskmr%2Flogo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263056762,"owners_count":23406818,"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":["golang","logging"],"created_at":"2025-07-02T01:06:11.946Z","updated_at":"2025-07-02T01:06:12.965Z","avatar_url":"https://github.com/linuskmr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# log + go = logo\n\nlogo is a logger for go.\n\n- Can log filename, line number, struct and function name at which the log method is called\n\n- Can suppress log messages with low log level\n\n- Logging without creating a logger struct first\n- Colored output of log level via ANSI-Code\n- String and JSON output\n- Can write to any `io.Writer`\n\n## Config Options\n\nA new logger can be created via `logo.New(flags)` or `logo.Logger{Property: Value}`. All `bool` values have matching flags, which can be combined via the bitwise or `flagA | flagB`. The `logger.Config(flags)` function can reconfigure an existing logger.\n\nThe standard logger used by `logo.Print()` can be reconfigured by using `logo.Config(flags)` or replaced with `logo.Standard = logo.Logo{}`.\n\n| Property   | Type         | Description                                                  | Default                                       |\n| ---------- | ------------ | ------------------------------------------------------------ | --------------------------------------------- |\n| Date       | `bool`       | Specifies whether the date should be displayed               | `true`                                        |\n| Time       | `bool`       | Specifies whether the time should be displayed               | `true`                                        |\n| Millis     | `bool`       | Specifies whether the milliseconds should be displayed       | `true`                                        |\n| Filename   | `bool`       | Specifies whether the filename and line should be displayed that was logged | `true`                                        |\n| Funcname   | `bool`       | Specifies whether the struct and function should be displayed where the logger was called | `true`                                        |\n| Json       | `bool`       | Specifies whether the output should be in Json format        | `true`                                        |\n| Output     | `io.Writer`  | The `io.Writer` the output of the logger shoud be written to | `os.Stdout`                                   |\n| DateFormat | `string`     | The date format of the output (in go's time format)          | YYYY-MM-DD (in go's time format \"2006-01-02\") |\n| TimeFormat | `string`     | The time format of the output (in go's time format)          | HH:MM:SS (in go's time format \"15:04:05\")     |\n| Level      | `logo.Level` | Level is the log level of this logger. The logger only logs messages with a level greater or equal to the log level. By default AllLevels is selected, which logs everything. | `logo.AllLevels`                              |\n\n## Log Levels\n\nThe logger logs all log messages with a log level greater or equal its `logger.Level`. The value of the log levels increases towards the bottom.\n\n| Level      | Function | Color  |\n| ---------- | -------- | ------ |\n| DebugLevel | Debug()  | Green  |\n| InfoLevel  | Info()   | Blue   |\n| WarnLevel  | Warn()   | Yellow |\n| ErrorLevel | Error()  | Red    |\n| PrintLevel | Print()  | Normal |\n| AllLevels  | -        | -      |\n\n## Example\n\n```go\nimport \"logo\"\n\nfunc main() {\n    logo.Print(\"Logging made easy\")\n    logo.Info(\"Different colors\")\n    logo.Warn(\"Uh yellow now\");\n    // PRINT: 2020-12-27 18:21:36.474 example.go:4 examples.main: Logging made easy\n    // INFO : 2020-12-27 18:21:36.476 example.go:5 examples.main: Different colors\n    // WARN : 2020-12-27 18:21:36.478 example.go:6 examples.main: Uh yellow now\n    \n    logo.Config(logo.Time | logo.Millis)\n    logo.Error(\"Some config options\")\n    // WARN : 18:21:36.478: Some config options\n    \n    logger := logo.New(logo.Filename | logo.Date)\n    logger.Debug(\"A logger object\")\n    // WARN : 2020-12-27 example.go:6: A logger object\n    \n    logger = logo.Logger{\n        Date:  true,\n        Level: WarnLevel,\n    }\n    logger.Debug(\"Due to the log level this message is not displayed\")\n    logger.Warn(\"But this message does\")\n    // WARN : 2020-12-27: But this message does\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuskmr%2Flogo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuskmr%2Flogo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuskmr%2Flogo/lists"}