{"id":18765825,"url":"https://github.com/yeqown/log","last_synced_at":"2026-01-19T06:01:33.705Z","repository":{"id":47611460,"uuid":"130456540","full_name":"yeqown/log","owner":"yeqown","description":"A light log library for go application. ","archived":false,"fork":false,"pushed_at":"2025-05-21T02:08:49.000Z","size":980,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-21T03:25:00.132Z","etag":null,"topics":["golang","lite","logging"],"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/yeqown.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}},"created_at":"2018-04-21T08:52:42.000Z","updated_at":"2025-05-21T02:07:49.000Z","dependencies_parsed_at":"2025-04-06T03:38:00.741Z","dependency_job_id":null,"html_url":"https://github.com/yeqown/log","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/yeqown/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeqown%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeqown%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeqown%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeqown%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeqown","download_url":"https://codeload.github.com/yeqown/log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeqown%2Flog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28562233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["golang","lite","logging"],"created_at":"2024-11-07T18:36:52.732Z","updated_at":"2026-01-19T06:01:33.686Z","avatar_url":"https://github.com/yeqown.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## log\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/yeqown/log)](https://goreportcard.com/report/github.com/yeqown/log) [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/yeqown/log)\n\na lite golang log library, easy to get start and no dependency.\n\n### Features\n\n- [x] `consolt` and `filelog` support \n\n- [x] `WithFields` support\n  \n- [x] lite and easy to use\n\n### Install \n\n```sh\ngo get -u github.com/yeqown/log \n```\n\n### Quick Start\n\nThere is sample code of using `log`.\n\n```go\npackage main\n\ntype embed struct {\n\tFieldA string\n\tFieldB int\n}\n\nfunc main() {\n\t// using builtin logger\n\tlog.Info(1, 2, 3, 4, 5)\n\tlog.Infof(\"this is format: %d\", 2)\n\n\tlog.\n\t\tWithField(\"key1\", \"value1\").\n\t\tWithFields(log.Fields{\n\t\t\t\"key2\": \"value2\",\n\t\t\t\"key3\": \"value3\",\n\t\t\t\"key4\": \"value4\",\n\t\t\t\"key5\": \"value5\",\n\t\t\t\"key6\": \"value6\",\n\t\t\t\"key7\": \"value7\",\n\t\t\t\"key8\": \"value8\",\n\t\t}).Error(\"test error\")\n\n\t// using new logger\n\tlogger, _ := log.NewLogger(\n\t\tlog.WithLevel(log.LevelError),\n\t\tlog.WithGlobalFields(log.Fields{\"global_key\": \"global_value\"}),\n\t)\n\tlogger.Info(1, 2, 3, 4, 5)\n\tlogger.Infof(\"this is format: %d\", 2)\n\tlogger.WithField(\"logger\", \"it's me\").\n\t\tWithFields(log.Fields{\n\t\t\t\"key2\": \"value2\",\n\t\t\t\"key3\": \"value3\",\n\t\t\t\"key4\": \"value4\",\n\t\t\t\"key5\": \"value5\",\n\t\t\t\"key6\": \"value6\",\n\t\t\t\"key7\": \"value7\",\n\t\t\t\"embed\": embed{\n\t\t\t\tFieldA: \"aaa\",\n\t\t\t\tFieldB: 112091,\n\t\t\t},\n\t\t\t\"embed_ptr\": \u0026embed{\n\t\t\t\tFieldA: \"aaa\",\n\t\t\t\tFieldB: 112091,\n\t\t\t},\n\t\t}).Error(\"test error\")\n    // [Error] file=\"/Users/yeqown/projects/opensource/log/logger_entry.go\" fn=\"github.com/yeqown/log.(*entry).output\" \n    // line=\"109\" timestamp=\"1596090798\" formatted_time=\"2020-07-30T14:33:18+08:00\" embed=\"{aaa 112091}\" \n    // embed_ptr=\"\u0026{aaa 112091}\" global_key=\"global_value\" key2=\"value2\" logger=\"it's me\" msg=\"test error\"\n}\n```\n\n### Migrate\n\nHere is a broken change from `d68941c` to `v1.x`. `v1.x` is advised to use.\n\n### shots\n\nHere are some shots of using example.\n\n##### 1. stdout shots\n\n\u003cimg src=\"./assets/shot1.png\" width=\"100%\"/\u003e\n\n##### 2. file shots\n\n\u003e output to stdout and file both.\n\n\u003cimg src=\"./assets/shot2.png\" width=\"100%\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeqown%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeqown%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeqown%2Flog/lists"}