{"id":37145831,"url":"https://github.com/menduo/pslog","last_synced_at":"2026-01-14T17:00:45.043Z","repository":{"id":57535049,"uuid":"283436537","full_name":"menduo/pslog","owner":"menduo","description":"A golang log wrapper with prefix.","archived":false,"fork":false,"pushed_at":"2020-09-08T09:51:44.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-06-20T00:45:48.435Z","etag":null,"topics":["go","golang","log","logging","struct-log"],"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/menduo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-29T08:00:42.000Z","updated_at":"2024-06-20T00:45:48.437Z","dependencies_parsed_at":"2022-09-08T06:52:58.586Z","dependency_job_id":null,"html_url":"https://github.com/menduo/pslog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/menduo/pslog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menduo%2Fpslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menduo%2Fpslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menduo%2Fpslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menduo%2Fpslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/menduo","download_url":"https://codeload.github.com/menduo/pslog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/menduo%2Fpslog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"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","log","logging","struct-log"],"created_at":"2026-01-14T17:00:28.079Z","updated_at":"2026-01-14T17:00:45.026Z","avatar_url":"https://github.com/menduo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PSlog\n\nA golang log wrapper with prefix.\n\n## Features\n\n1. Now is based on `logrus`.\n2. Log content with prefix string.\n3. Create sub logger with grouped prefix\n4. Error with prefix string.\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"github.com/menduo/pslog\"\n\t\"github.com/sirupsen/logrus\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tl1 := pslog.New(\"l1\")\n\tl1sub1 := l1.Sub(\"sub1\", pslog.WithErrorFormat(\"我的天哪出错了: %s\"))\n\n\tl2 := pslog.New(\"l2\")\n\n\tl2sub1 := l2.Sub(\"sub1\")\n\n\tl3 := pslog.New(\"l3\", pslog.WithLogger(logrus.New()))\n\n\tl1.Warn(\"hello\")\n\tl2.Warn(\"hello\")\n\tl3.Warn(\"hello\")\n\tl1sub1.Warn(\"hello\")\n\tl2sub1.Warn(\"hello\")\n\n\t// output:\n\t/*\n\t\tWARN[0000] [l1]hello\n\t\tWARN[0000] [l2]hello\n\t\tWARN[0000] [l3]hello\n\t\tWARN[0000] [l1.sub1]hello\n\t\tWARN[0000] [l2.sub2]hello\n\t*/\n\terr1 := l1.NewErrWithMsgs(\"this is an error\")\n\terr1sub1 := l1sub1.NewErrWithFormat(\"i am what i am %s\", \"what i am...\")\n\n\tl2.Infoln(\"err1==nil\", err1 == nil)         // false\n\tl2.Infoln(\"err1.Error():   \", err1.Error()) // -\u003e [l1]:  this is an error\n\n\tl1.Infoln(\"err1sub1==nil\", err1sub1 == nil) // false\n\tl3.Infoln(\"err1sub1 ===:\", err1sub1.Error())\n\t// \tl2.Infoln(\"err1.Error():   \", err1.Error()) // -\u003e [l1]:  this is an error\n\n\tl4 := pslog.New(\"l4\", pslog.WithPSGenerOption(func(pslist []string) string {\n\t\treturn \"这是什么前缀啊....\" + strings.Join(pslist, \"---\")\n\t}))\n\n\tl4.Infoln(\"hello\") // 这是什么前缀啊....l4 hello\n}\n\n\n```\n\n## License\n\nMIT License\n\n## Contact\n\nshimenduo@gmail.com\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmenduo%2Fpslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmenduo%2Fpslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmenduo%2Fpslog/lists"}