{"id":15473756,"url":"https://github.com/adwpc/xlog","last_synced_at":"2025-07-30T10:44:28.777Z","repository":{"id":144262701,"uuid":"269395029","full_name":"adwpc/xlog","owner":"adwpc","description":"simple and powerful golang logger which support console|file|rorate|k-v print|...","archived":false,"fork":false,"pushed_at":"2024-01-05T07:48:26.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T13:44:51.379Z","etag":null,"topics":["console","golang","k-v-print","logger","rorate","save-to-file"],"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/adwpc.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,"publiccode":null,"codemeta":null}},"created_at":"2020-06-04T15:22:58.000Z","updated_at":"2023-12-06T02:51:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"345a81e6-7ce1-4459-b723-8e5d3347433a","html_url":"https://github.com/adwpc/xlog","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fxlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fxlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fxlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adwpc%2Fxlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adwpc","download_url":"https://codeload.github.com/adwpc/xlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246034278,"owners_count":20712857,"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":["console","golang","k-v-print","logger","rorate","save-to-file"],"created_at":"2024-10-02T03:00:29.982Z","updated_at":"2025-03-28T13:20:55.808Z","avatar_url":"https://github.com/adwpc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[中文](https://github.com/adwpc/xlog/blob/master/README_CN.md)\n## Getting Started\n\n```\npackage main\n\nimport (\n\txlog \"github.com/adwpc/xlog\"\n)\n\nfunc main() {\n\txlog.Init(xlog.TinyCoderConsoleConfig)\n\tdefer xlog.Close()\n\n\txlog.Infof(\"Call Infof: %s %d %v\", \"abc\", 123, 1.23)\n\txlog.Info(\"Call Info\", \"string\", \"abc\", \"int\", 123, \"float\", 1.23)\n}\n```\n\n## Feature \n- [x] Easy to use\n- [x] High performance base on zerolog\n- [x] Support printing field\n\t- [x] log level\n\t- [x] caller code line (eg:`example.go:32` you can go to this line by alt+click it in IDE)\n\t- [x] caller function name\n\t- [x] time format\n\t- [x] format message (use Infof/Debugf/Xxxxf like fmt.Printf())\n\t- [x] key-value message (use Info/Debug/Xxxx recommend, without writing %v)\n\t- [x] all type support(int/string/float64/map/struct/interface)\n\t\n- [x] Support output to console\n\t- [x] pretty logging\n            ![tiny](https://raw.githubusercontent.com/adwpc/xlog/master/snapshot/tiny_console.png)\n\t- [x] Support output format normal\n\t\n\t```\n\t[2023-08-24 17:48:17.227] [I] [example.go:88][TestOutputToConsoleNormal] TestOutputToConsoleNormal Info float=1.23 int=123 map={\"a\":1,\"b\":2} string=abc struct=\"{a:1 b:{b:1} c:map[a:1 b:2]}\"\n\t[2023-08-24 17:48:17.227] [I] [example.go:88][TestOutputToConsoleNormal] TestOutputToConsoleNormal Infof: abc 123 1.23 map[a:1 b:2] {a:1 b:{b:1} c:map[a:1 b:2]}\n\t```\n\t\n\t\n\t- [x] Support output format json\n\t\n\t```\n\t{\"level\":\"info\",\"time\":\"2023-08-24 18:12:04.099\",\"caller\":\"example.go:32\",\"message\":\"TestOutputToConsoleJson Infof: abc 123 1.23 map[a:1 b:2] {a:1 b:{b:1} c:map[a:1 b:2]}\"}\n\t{\"level\":\"info\",\"string\":\"abc\",\"int\":123,\"float\":1.23,\"map\":{\"a\":1,\"b\":2},\"struct\":\"{a:1 b:{b:1} c:map[a:1 b:2]}\",\"time\":\"2023-08-24 18:12:04.099\",\"caller\":\"example.go:33\",\"message\":\"TestOutputToConsoleJson Info\"}\n\t```\n\n- [x] Support output to file\n\t- [x] Support file rolling\n\t\n\t```\n\tTestOutputToFileJson.log\n\tTestOutputToFileJson.log.2023-08-24 17:10:44\n\tTestOutputToFileJson.log.2023-08-24 17:30:03\n\t```\n\t\n\t- [x] Support output format normal\n\t\n\t```\n\t[2023-08-24 17:30:08.343] [I] [example.go:75][TestOutputToFileNormal] TestOutputToFileNormal Info float=1.23 int=123 map={\"a\":1,\"b\":2} string=abc struct=\"{a:1 b:{b:1} c:map[a:1 b:2]}\"\n\t[2023-08-24 17:30:08.343] [I] [example.go:75][TestOutputToFileNormal] TestOutputToFileNormal Infof: abc 123 1.23 map[a:1 b:2] {a:1 b:{b:1} c:map[a:1 b:2]}\n\t```\n\t\n\t\n\t- [x] Support output format json\n\t\n\t```\n\t{\"level\":\"info\",\"string\":\"abc\",\"int\":123,\"float\":1.23,\"map\":{\"a\":1,\"b\":2},\"struct\":\"{a:1 b:{b:1} c:map[a:1 b:2]}\",\"time\":\"2023-08-24 18:13:10.455\",\"caller\":\"example.go:33\",\"message\":\"TestOutputToFileJson Info\"}\n\t{\"level\":\"info\",\"time\":\"2023-08-24 18:13:10.455\",\"caller\":\"example.go:32\",\"message\":\"TestOutputToFileJson Infof: abc 123 1.23 map[a:1 b:2] {a:1 b:{b:1} c:map[a:1 b:2]}\"}\n\n\t```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwpc%2Fxlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadwpc%2Fxlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadwpc%2Fxlog/lists"}