{"id":13414126,"url":"https://github.com/kirillDanshin/dlog","last_synced_at":"2025-03-14T20:31:07.565Z","repository":{"id":57497023,"uuid":"62585134","full_name":"kirillDanshin/dlog","owner":"kirillDanshin","description":"Simple build-time controlled debug log with ability to log where the logger was called","archived":false,"fork":false,"pushed_at":"2017-07-28T00:08:08.000Z","size":21,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-23T02:55:27.527Z","etag":null,"topics":["compile-time-enabling","debug","debuging-tool","dlog","golang","log"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirillDanshin.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}},"created_at":"2016-07-04T19:59:09.000Z","updated_at":"2022-09-27T09:47:26.000Z","dependencies_parsed_at":"2022-09-03T23:50:55.699Z","dependency_job_id":null,"html_url":"https://github.com/kirillDanshin/dlog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillDanshin%2Fdlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillDanshin%2Fdlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillDanshin%2Fdlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirillDanshin%2Fdlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirillDanshin","download_url":"https://codeload.github.com/kirillDanshin/dlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243642088,"owners_count":20323954,"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":["compile-time-enabling","debug","debuging-tool","dlog","golang","log"],"created_at":"2024-07-30T20:01:58.401Z","updated_at":"2025-03-14T20:31:07.272Z","avatar_url":"https://github.com/kirillDanshin.png","language":"Go","funding_links":[],"categories":["工具库","Utilities","工具库`可以提升效率的通用代码库和工具`","公用事业公司","實用工具","Utility","实用工具"],"sub_categories":["交流","HTTP Clients","查询语","Utility/Miscellaneous","实用程序/Miscellaneous","Advanced Console UIs","高級控制台界面","高级控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","Fail injection"],"readme":"# dlog [![GoDoc](https://godoc.org/github.com/kirillDanshin/dlog?status.svg)](https://godoc.org/github.com/kirillDanshin/dlog) [![Go Report Card](https://goreportcard.com/badge/github.com/kirillDanshin/dlog)](https://goreportcard.com/report/github.com/kirillDanshin/dlog)\nSimple build-time controlled debug log\n\n# How to use\n### Unbuffered\n```go\npackage main\n\nimport \"github.com/kirillDanshin/dlog\"\n\nfunc main() {\n\ta := []int{2, 4, 8, 16, 32, 64, 128, 256, 512}\n\tb := \"some string\"\n\t\n\tdlog.D(a)\t\t// D'ump `a`\n\tdlog.P(b)\t\t// P'rint `b`\n\tdlog.F(\"%s format\", b)\t// F'ormatted print\n\tdlog.Ln(b)\t\t// print'Ln `b`\n}\n```\n\n### Buffered\n```go\npackage main\n\nimport \"github.com/kirillDanshin/dlog\"\n\nfunc main() {\n\tlog := dlog.NewBuffered()\n\tdefer log.Release()\n\t\n\tlog.D(a)\t\t// D'ump `a`\n\tlog.P(b)\t\t// P'rint `b`\n\tlog.F(\"%s format\", b)\t// F'ormatted print\n\tlog.Ln(b)\t\t// print'Ln `b`\n\n\tdlog.Ln(log) // or fmt.Println(\"log\") etc.\n}\n```\n\n# Release\nTo disable logging in release build just run\n```bash\n\tgo build\n```\n\n# Debug\nTo enable logging in debug build run\n```bash\n\tgo build -tags \"debug\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FkirillDanshin%2Fdlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FkirillDanshin%2Fdlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FkirillDanshin%2Fdlog/lists"}