{"id":46289694,"url":"https://github.com/zenmuharom/zenlogger","last_synced_at":"2026-03-04T08:01:00.912Z","repository":{"id":65826794,"uuid":"572042889","full_name":"zenmuharom/zenlogger","owner":"zenmuharom","description":"zenlogger | Smart logger library for GOlang that you can use and customize easily :robot:","archived":false,"fork":false,"pushed_at":"2025-11-21T08:03:27.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-21T10:08:17.086Z","etag":null,"topics":["go","golang","golang-package","logger","logging","logging-library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zenmuharom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-29T12:41:33.000Z","updated_at":"2025-11-21T08:01:46.000Z","dependencies_parsed_at":"2023-09-26T23:06:50.455Z","dependency_job_id":"419d3021-ac0c-41df-aa36-352aba011b00","html_url":"https://github.com/zenmuharom/zenlogger","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/zenmuharom/zenlogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenmuharom%2Fzenlogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenmuharom%2Fzenlogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenmuharom%2Fzenlogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenmuharom%2Fzenlogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenmuharom","download_url":"https://codeload.github.com/zenmuharom/zenlogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenmuharom%2Fzenlogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["go","golang","golang-package","logger","logging","logging-library"],"created_at":"2026-03-04T08:01:00.040Z","updated_at":"2026-03-04T08:01:00.907Z","avatar_url":"https://github.com/zenmuharom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zenlogger :robot:\n[![GoDoc][doc-img]][doc]\n\nThis library is built based on internal \u0026 personal needs.\nSo, this lib can be not suit for your need.\n\n\n\n**This library support such as**\n- Logging to file (including customize naming file)\n- Structured log to satisfy Gcloud logs structure \n- Customize structure \u0026 keys\n\n# Sample Output\n\n###Sample structured output log\n\nThis is the sample of output output when beautifyJson set to `true`.\n```\n{\n  \"pid\": \"97732c84970d49a883193352f7da24f3\",\n  \"severity\": \"Info\",\n  \"timestamp\": \"2022-11-29T20:01:48+0700\",\n  \"caller\": \"map_test.go:47\",\n  \"message\": {\n    \"title\": \"test map\",\n    \"values\": {\n      \"halo\": {\n        \"2\": \"two\",\n        \"developer\": {\n          \"Age\": 27,\n          \"Gender\": \"male\",\n          \"IsMarried\": false,\n          \"Name\": \"Zeni\",\n          \"Relationship\": \"\",\n          \"Supporter\": [\n            {\n              \"Age\": 22,\n              \"Gender\": \"bunga\",\n              \"IsMarried\": true,\n              \"Name\": \"Mawar\",\n              \"Relationship\": \"\",\n              \"Supporter\": []\n            },\n            {\n              \"Age\": 20,\n              \"Gender\": \"warna\",\n              \"IsMarried\": false,\n              \"Name\": \"Hitam\",\n              \"Relationship\": \"\",\n              \"Supporter\": []\n            }\n          ]\n        },\n        \"four\": 4,\n        \"one\": 1,\n        \"three\": \"tilu\"\n      }\n    }\n  }\n}\n```\n\n\u003cbr /\u003e\n\n### Installation :rocket:\n**How to use**:\nThis is the sample code of zenlogger usage\n```\npackage main\n\nimport (\n\t\"github.com/zenmuharom/zenlogger\"\n)\n\ntype Person struct {\n\tName         string\n\tGender       string\n\tAge          int\n\tIsMarried    bool\n\tRelationship string\n\tSupporter    []Person\n}\n\nfunc Test_map(t *testing.T) {\n\n\tlogger := NewZenlogger()\n\tlogger.SetConfig(Config{BeautifyJson: true})\n\n\tperson := Person{\n\t\tName:      \"Zeni\",\n\t\tGender:    \"male\",\n\t\tAge:       27,\n\t\tIsMarried: false,\n\t\tSupporter: []Person{\n\t\t\t{\n\t\t\t\tName:      \"Mawar\",\n\t\t\t\tAge:       22,\n\t\t\t\tGender:    \"bunga\",\n\t\t\t\tIsMarried: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:      \"Hitam\",\n\t\t\t\tAge:       20,\n\t\t\t\tGender:    \"warna\",\n\t\t\t\tIsMarried: false,\n\t\t\t},\n\t\t},\n\t}\n\n\ttestMap := map[string]interface{}{\n\t\t\"one\":       \"1\",\n\t\t\"2\":         \"two\",\n\t\t\"three\":     \"tilu\",\n\t\t\"four\":      4,\n\t\t\"developer\": person,\n\t}\n\tlogger.Info(\"test map\", ZenField{Key: \"halo\", Value: testMap})\n}\n\n```\n\u003cbr/\u003e\n\n### Config\nThis is the sample of config you can customize\n```\n\tlogger := zenlogger.NewZenlogger()\n\tconfig := zenlogger.Config{\n\t\tPid: zenlogger.ZenConf{\n\t\t\tLabel: \"insertId\",\n\t\t},\n\t\tSeverity: zenlogger.Severity{\n\t\t\tLabel:   \"Level\",\n\t\t\tAccess:  \"API\",\n\t\t\tInfo:    \"THIS IS INFO\",\n\t\t\tDebug:   \"DEBUG\",\n\t\t\tWarning: \"Please Attention To This\",\n\t\t\tError:   \"Fault\",\n\t\t\tQuery:   \"DB\",\n\t\t},\n\t\tCaller: zenlogger.Caller{\n\t\t\tLabel: \"trace_file\",\n\t\t\tLevel: 0,\n\t\t},\n\t\tMessage: zenlogger.Message{\n\t\t\tLabel: \"pesan\",\n\t\t\tTitle: zenlogger.ZenConf{\n\t\t\t\tLabel: \"judul\",\n\t\t\t},\n\t\t\tValues: zenlogger.ZenConf{\n\t\t\t\tLabel: \"isi\",\n\t\t\t},\n\t\t},\n\t\tBeautifyJson: true,\n\t}\n\tlogger.SetConfig(config)\n```\n\n\n### Set log to file\nYou can set the log to make zenlogger write into file by adding:\n```\n\tconfig := zenlogger.Config{}\n\tconfig.Output.Path = \"logs\"\n\tconfig.Output.Format = \"20060102\"\n\tconfig.BeautifyJson = true\n\tlogger.SetConfig(config)\n```\nZenlogger will automatically make directory logs (if not exists), and write into file with golang timed format.\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n### Config Property :robot:\n| Property  | sub  |description   |\n| ------------ | ------------ | ------------ |\n| Pid |  | process id is label of the key that differentiate with another process in your program  | \n| Severity  | Label  | The label of severity key   |\n| Severity  | Access   | The value of severity when you call zenlogger.Access()   |\n| Severity  | Info   | The value of severity when you call zenlogger.Info()   |\n| Severity  | Debug   | The value of severity when you call zenlogger.Debug()   |\n| Severity  | Warning   | The value of severity when you call zenlogger.Warning()   |\n| Severity  | Error   | The value of severity when you call zenlogger.Error()   |\n| Severity  | Query   | The value of severity when you call zenlogger.Query()   |\n| DateTime  | Label | The label of datetime key when log written |\n| DateTime  | Format | The output datetime format, using standard GO datetime format |\n| Caller    | Label | The label of caller key |\n| Caller    | Level | The level of caller key. the default is 0 |\n| Message   | Label   | The label of message key   |\n| Message   | Title.Label   | The label of title key   |\n| Message   | Values.Label   | The label of values key   |\n| BeautifyJson  |   | The beautify config, true to make it beautify formatted, otherwise, set it to false   |\n| Output  | Path  | The output path of log files   |\n| Output  | Format  | The output file name using datetime GO format   |\n\n\n\n\nYou can set or try it in the link below here: \n:point_right: [GO Play](https://goplay.tools/snippet/i9cDLZ8yVHf \"GO Play\").  :point_left:\n\u003cbr\u003e\u003cbr\u003e\n\nThis library is released under: [MIT License](https://github.com/zenmuharom/zenlogger/blob/master/LICENSE.txt \"MIT License\").\n\n[doc-img]: https://pkg.go.dev/badge/github.com/zenmuharom/zenlogger\n[doc]: https://pkg.go.dev/github.com/zenmuharom/zenlogger","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenmuharom%2Fzenlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenmuharom%2Fzenlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenmuharom%2Fzenlogger/lists"}