{"id":18749303,"url":"https://github.com/mengdu/mo","last_synced_at":"2025-08-10T07:06:05.075Z","repository":{"id":174579431,"uuid":"645125064","full_name":"mengdu/mo","owner":"mengdu","description":"A leveled logger library for golang.","archived":false,"fork":false,"pushed_at":"2025-08-02T10:08:07.000Z","size":594,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T11:36:59.003Z","etag":null,"topics":["golang","log","logger","mo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mengdu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-25T01:31:59.000Z","updated_at":"2025-08-02T10:08:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0b84b19-caaf-4aa9-bcc8-047035a3320b","html_url":"https://github.com/mengdu/mo","commit_stats":null,"previous_names":["mengdu/mo"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/mengdu/mo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengdu%2Fmo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengdu%2Fmo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengdu%2Fmo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengdu%2Fmo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mengdu","download_url":"https://codeload.github.com/mengdu/mo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mengdu%2Fmo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269688280,"owners_count":24459431,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":["golang","log","logger","mo"],"created_at":"2024-11-07T17:07:07.720Z","updated_at":"2025-08-10T07:06:05.037Z","avatar_url":"https://github.com/mengdu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mo\n\n![Preview](preview.png)\n\nA leveled logger library for golang.\n\n```sh\ngo get github.com/mengdu/mo\n```\n\n```go\npackage main\nimport (\n\t\"github.com/mengdu/mo\"\n)\n\nfunc main() {\n\tmo.SetBase(\n\t\tmo.Value(\"ts\", mo.Timestamp(\"15:04:05.000\")),\n\t\tmo.Value(\"caller\", mo.Caller(4)),\n\t\tmo.Value(\"tag\", \"dev\"),\n\t)\n\n\tmo.Debug(\"debug message\")\n\tmo.Info(\"info message\")\n\tmo.Warn(\"warn message\")\n\tmo.Error(\"error message\")\n\t// mo.Fatal(\"fatal message\")\n\n\tmo.Debugf(\"debugf message %s\", \"test\")\n\tmo.Infof(\"infof message %s\", \"test\")\n\tmo.Warnf(\"warnf message %s\", \"test\")\n\tmo.Errorf(\"errorf message %s\", \"test\")\n\t// mo.Fatalf(\"fatalf message %s\", \"test\")\n\n\tmo.Debugw(\"debugw message\", mo.Value(\"k1\", 123), mo.Value(\"k2\", true), mo.Value(\"k3\", []int{1, 2, 3}))\n\tmo.Infow(\"infow message\", mo.Value(\"k1\", 123), mo.Value(\"k2\", true), mo.Value(\"k3\", []int{1, 2, 3}))\n\tmo.Warnw(\"warnw message\", mo.Value(\"k1\", 123), mo.Value(\"k2\", true), mo.Value(\"k3\", []int{1, 2, 3}))\n\tmo.Errorw(\"errorw message\", mo.Value(\"k1\", 123), mo.Value(\"k2\", true), mo.Value(\"k3\", []int{1, 2, 3}))\n\t// mo.Fatalw(\"fatalw message\", mo.Value(\"k1\", 123), mo.Value(\"k2\", true), mo.Value(\"k3\", []int{1, 2, 3}))\n}\n```\n\n- [Example](examples/main.go)\n- [Rotate Example](examples/rotate/main.go)\n- [Opentelemetry Example](examples/otel/main.go)\n\n## Benchmark\n\n```\ngo test -cpu=4 -benchmem -benchtime=5s -bench \"^Benchmark\"\ngoos: darwin\ngoarch: amd64\npkg: github.com/mengdu/mo\ncpu: Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz\nBenchmarkDefault-4                      39429948               138.1 ns/op            64 B/op          2 allocs/op\nBenchmarkDefaultWithCaller-4             8169790               660.9 ns/op           496 B/op         18 allocs/op\nBenchmarkJson-4                         17008795               339.4 ns/op           124 B/op          6 allocs/op\nBenchmarkJsonWithCaller-4                5119900              1157 ns/op             512 B/op         16 allocs/op\nBenchmarkJsonWithCallerFull-4            3169348              1869 ns/op             720 B/op         24 allocs/op\nPASS\nok      github.com/mengdu/mo    38.280s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmengdu%2Fmo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmengdu%2Fmo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmengdu%2Fmo/lists"}