{"id":37114935,"url":"https://github.com/task4233/dl","last_synced_at":"2026-01-14T13:30:22.880Z","repository":{"id":42657266,"uuid":"470423535","full_name":"task4233/dl","owner":"task4233","description":"The logger not committed to Git for debug","archived":false,"fork":false,"pushed_at":"2023-06-01T22:45:44.000Z","size":3280,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T12:51:50.046Z","etag":null,"topics":["debug","go","golang","logger","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/task4233.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}},"created_at":"2022-03-16T03:51:16.000Z","updated_at":"2024-06-08T02:20:13.000Z","dependencies_parsed_at":"2023-07-13T01:00:30.639Z","dependency_job_id":null,"html_url":"https://github.com/task4233/dl","commit_stats":null,"previous_names":["task4233/delog"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/task4233/dl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/task4233%2Fdl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/task4233%2Fdl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/task4233%2Fdl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/task4233%2Fdl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/task4233","download_url":"https://codeload.github.com/task4233/dl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/task4233%2Fdl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"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":["debug","go","golang","logger","logging"],"created_at":"2026-01-14T13:30:22.225Z","updated_at":"2026-01-14T13:30:22.871Z","avatar_url":"https://github.com/task4233.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"dl - The logger not committed to Git for debug\n======\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/task4233/dl/v2.svg)](https://pkg.go.dev/github.com/task4233/dl/v2)\n[![.github/workflows/ci.yml](https://github.com/task4233/dl/actions/workflows/ci.yml/badge.svg)](https://github.com/task4233/dl/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/task4233/dl)](https://goreportcard.com/report/github.com/task4233/dl)\n[![codecov](https://codecov.io/gh/task4233/dl/branch/main/graph/badge.svg?token=xrhysp4Tzf)](https://codecov.io/gh/task4233/dl)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\n\n![delog.gif](https://user-images.githubusercontent.com/29667656/159164178-f72aede7-f825-438a-add6-aa3deedf8c4c.gif)\n\n## Description\nWho doesn't write wrong codes? No one.  \nThen, programs don't work well, and developers write logs for debug to understand what happens.\n\nHowever, some developers forget to delete their logs after resolving the problem and push their codes. In the worse case, the logs might be released.\n\n**dl** is developed to resolve their problems.\n\n## Features\n- **Logging package for debug in Go**\n  - [`dl` provides wrapping function for **logr.Logger**](https://pkg.go.dev/github.com/task4233/dl/v2#NewLogger).\n- **Command for parallel Sweeping all functions of this package**\n- **Command for installing git hooks and .gitignore**\n\n## Installation\n### Go 1.17 or earlier\nIt doesn't contain a generics feature.\n\n```bash\n$ go install github.com/task4233/dl/cmd/dl@v1\n```\n\n### Go 1.18\n\n```bash\n$ go install github.com/task4233/dl/v2/cmd/dl@main\n```\n\n## Usage\n\n1. debug your codes with `dl` package\n\n[Playground](https://go.dev/play/p/Et8JfM-gxZ-)\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/task4233/dl/v2\"\n)\n\ntype U[T any] []T\n\nfunc (t U[T]) append(v T) {\n\tt = append(t, v)\n\t// debug\n\tdl.Info(t)\n}\n\nfunc (t U[T]) change(v T) {\n\tt[0] = v\n\t// debug\n\tdl.FInfo(os.Stdout, t)\n}\n\nfunc main() {\n\tt := U[int]([]int{1, 3})\n\tt.append(5)\n\tt.change(5)\n}\n\n\n// Output:\n// [DeLog] info: main.U[int]{1, 3, 5} (main.U[int]) prog.go:13\n// [DeLog] info: main.U[int]{5, 3} (main.U[int]) prog.go:18\n```\n\n2. Install dl\n\n```bash\n$ dl init .\n```\n\n3. Just commit\n\n- `delog` is used in the file.\n\n```bash\n$ cat main.go \npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/task4233/dl/v2\"\n)\n\ntype U[T any] []T\n\nfunc (t U[T]) append(v T) {\n\tt = append(t, v)\n\t// debug\n\tdl.Info(t)\n}\n\nfunc (t U[T]) change(v T) {\n\tt[0] = v\n\t// debug\n\tdl.FInfo(os.Stdout, t)\n}\n\nfunc main() {\n\tt := U[int]([]int{1, 3})\n\tt.append(5)\n\tt.change(5)\n}\n```\n\n- invoke `$ git commit`\n\n```bash\n$ git add main.go\n$ git commit -m \"feat: add main.go\"\nremove dl from main.go # automatically removed\n[master 975ecf9] feat: add main.go\n 1 file changed, 12 insertions(+), 21 deletions(-)\n rewrite main.go (91%)\n```\n\n- `delog` is removed automatically\n\n```bash\n$ git diff HEAD^\ndiff --git a/main.go b/main.go\nindex 90a78bd..0e28e8a 100644\n--- a/main.go\n+++ b/main.go\n@@ -0,0 +1,27 @@\n+package main\n+\n+import (\n+       \"os\"\n+\n+       \"github.com/task4233/dl/v2\"\n+)\n+\n+type U[T any] []T\n+\n+func (t U[T]) append(v T) {\n+       t = append(t, v)\n+       // debug\n+\n+}\n+\n+func (t U[T]) change(v T) {\n+       t[0] = v\n+       // debug\n+\n+}\n+\n+func main() {\n+       t := U[int]([]int{1, 3})\n+       t.append(5)\n+       t.change(5)\n+}\n```\n\n- removed `delog` codes are restored(not commited)\n\n```bash\n$ cat main.go \npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/task4233/dl/v2\"\n)\n\ntype U[T any] []T\n\nfunc (t U[T]) append(v T) {\n\tt = append(t, v)\n\t// debug\n\tdl.Info(t)\n}\n\nfunc (t U[T]) change(v T) {\n\tt[0] = v\n\t// debug\n\tdl.FInfo(os.Stdout, t)\n}\n\nfunc main() {\n\tt := U[int]([]int{1, 3})\n\tt.append(5)\n\tt.change(5)\n}\n```\n\n### Remove dl from GitHooks\n\n```bash\n$ dl remove .\n```\n\n## Contribution\nPlease feel free to make [issues](https://github.com/task4233/dl/issues/new/choose) and pull requests.\n\n## Author\n[task4233](https://github.com/task4233)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftask4233%2Fdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftask4233%2Fdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftask4233%2Fdl/lists"}