{"id":21392340,"url":"https://github.com/hiyali/logli","last_synced_at":"2025-03-16T13:42:02.189Z","repository":{"id":84520011,"uuid":"183202116","full_name":"hiyali/logli","owner":"hiyali","description":"🏳️‍🌈 A colored logger of golang","archived":false,"fork":false,"pushed_at":"2019-04-25T15:12:16.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T01:23:01.674Z","etag":null,"topics":["color","color-log","go","golang","log","logger","logging"],"latest_commit_sha":null,"homepage":"","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/hiyali.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-04-24T10:02:59.000Z","updated_at":"2019-05-09T07:14:48.000Z","dependencies_parsed_at":"2023-03-02T04:30:38.580Z","dependency_job_id":null,"html_url":"https://github.com/hiyali/logli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Flogli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Flogli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Flogli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiyali%2Flogli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiyali","download_url":"https://codeload.github.com/hiyali/logli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878428,"owners_count":20362432,"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":["color","color-log","go","golang","log","logger","logging"],"created_at":"2024-11-22T13:40:11.711Z","updated_at":"2025-03-16T13:42:02.164Z","avatar_url":"https://github.com/hiyali.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏳️‍🌈 logli\n\u003e A colored logger of golang\n\n## Take a look\n\n#### Install\n```shell\ngo get -u github.com/hiyali/logli\n```\n\n#### Usage\n```golang\nimport (\n  log \"github.com/hiyali/logli\"\n)\n\nfunc main() {\n  log.Debug(\"This is a debug log actually\")\n  log.FatalF(\"Damn, there is an error: %v\", err) // followed an os.Exit(1)\n}\n```\n\n#### Screenshots\n![Methods](https://raw.githubusercontent.com/hiyali/logli/master/screenshots/methods.png \"methods\")\n\n## Methods\n\n#### General\n| Name    | Color   | Usage   |\n|---      |---      |---      |\n| Print   | Default | `log.Print(msg string)`                             |\n| PrintF  | Default | `log.Printf(format string, values ...interface{})`  |\n| Debug   | Cyan    | Same as Print, like `log.Debug(msg string)`                             |\n| DebugF  | Cyan    | Same as PrintF, like `log.DebugF(format string, values ...interface{})`  |\n| Info    | Green   | Same to Debug  |\n| InfoF   | Green   | Same to DebugF |\n| Warn    | Yellow  | Same to Debug  |\n| WarnF   | Yellow  | Same to DebugF |\n| Error   | Red     | Same to Debug  |\n| ErrorF  | Red     | Same to DebugF |\n| Fatal   | Red     | Same to Error and following os.Exit(1)    |\n| FatalF  | Red     | Same to ErrorF and following os.Exit(1)   |\n\n#### Customize\n| Name          | Color       | Usage   |\n|---            |---          |---      |\n| CustomPrint   | As you wish | `log.CustomPrint(msg string, color color, typ int)`    |\n| CustomPrintNT | Like above  | `log.CustomPrintNT(msg string, color color, typ int)` and no time will automatically print     |\n| Colorize      | You will choose | `log.Colorize(msg string, color color) -\u003e (result string)` no any print here, but would return colorized result string |\n\n#### Other\n| Name          \t\t\t| Usage   |\n|---            \t\t\t|---      |\n| SetCustomTimeFormat | `log.SetCustomTimeFormat(\"2006-01-02 15:04:05\")` \t\t\t\t|\n| Now\t\t\t\t\t\t\t\t\t| `log.Now() -\u003e (now string)` return time string for now \t|\n\n## Configs\n\n#### log.Config Options\n| Option            | Type        | Default |\n|---                |---          |---      |\n| TimeDisabled      | bool        | false   |\n| ColorDisabled     | bool        | false   |\n| TimeColor         | color       | Color.Default       |\n| TimeFormat        | time_format | TimeFormat.Default (\"2006-01-02 15:04:05\") |\n\n\u003e How can I set config?\n\n```golang\nlog.SetConfig(\u0026log.Config{\n  TimeDisabled:   true,\n  ColorDisabled:  false,\n  ...\n})\n```\n\n![Time Disabled True](https://raw.githubusercontent.com/hiyali/logli/master/screenshots/time_disabled_true.png \"time disabled true\")\n![Time Disabled False](https://raw.githubusercontent.com/hiyali/logli/master/screenshots/time_disabled_false.png \"time disabled false\")\n\n#### log.Color color\n![Colors](https://raw.githubusercontent.com/hiyali/logli/master/screenshots/colors.png \"colors\")\n\n\u003e How can I use these colors?\n\n```golang\nlog.Color.Blue -\u003e color\n...\nlog.CustomPrint(\"Hey yo\", log.Color.LightRed, log.TypeFace.Normal)\n```\n\n#### log.TimeFormat time_format\n![TimeFormats](https://raw.githubusercontent.com/hiyali/logli/master/screenshots/time_formats.png \"time formats\")\n\n\u003e How can I get and use these time formats?\n\n```golang\nlog.TimeFormat.UnixDate -\u003e time_format\n...\nlog.SetConfig(\u0026log.Config{\n  TimeFormat: log.TimeFormat.Stamps,\n  ...\n})\n```\n\n## Print\n\n\u003e Print all things it can do.\n\n```golang\nlog.FullLook()\n```\n\u003e OR some of them\n```golang\nlog.TakeLook()\nlog.Color.Print()\nlog.TimeFormat.Print()\n```\n\n## Contribute\n\u003e Feel free\n\n## License\nMIT\n\n---\n\ninspired By [bclicn/color](https://github.com/bclicn/color)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiyali%2Flogli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiyali%2Flogli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiyali%2Flogli/lists"}