{"id":19311918,"url":"https://github.com/kyslik/gaglog","last_synced_at":"2026-06-22T09:32:09.119Z","repository":{"id":206664639,"uuid":"714827806","full_name":"Kyslik/gaglog","owner":"Kyslik","description":"gaglog is a Go package that adds regex/duration based filtering to the standard library log package.","archived":false,"fork":false,"pushed_at":"2023-11-13T14:40:35.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T03:44:34.732Z","etag":null,"topics":["go","log","logging","throttling"],"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/Kyslik.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":"2023-11-05T23:08:36.000Z","updated_at":"2023-11-26T12:27:13.000Z","dependencies_parsed_at":"2024-11-10T00:31:28.322Z","dependency_job_id":null,"html_url":"https://github.com/Kyslik/gaglog","commit_stats":null,"previous_names":["kyslik/gaglog"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Kyslik/gaglog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyslik%2Fgaglog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyslik%2Fgaglog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyslik%2Fgaglog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyslik%2Fgaglog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kyslik","download_url":"https://codeload.github.com/Kyslik/gaglog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyslik%2Fgaglog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34643612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","log","logging","throttling"],"created_at":"2024-11-10T00:31:19.278Z","updated_at":"2026-06-22T09:32:09.098Z","avatar_url":"https://github.com/Kyslik.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gaglog [![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/kyslik/gaglog/v1) [![Latest Release](https://img.shields.io/github/v/release/kyslik/gaglog?style=flat-square)](https://github.com/kyslik/gaglog/releases/latest) ![Build Status](https://github.com/kyslik/gaglog/actions/workflows/test.yaml/badge.svg?branch=main)\n\n`gaglog` is a Go package that adds regex/duration based filtering to the standard library [`log`](https://pkg.go.dev/log) package.\n\nThis package was heavily influenced by [`hashicorp/logutils`](https://github.com/hashicorp/logutils) package.\n\n## Simple example\n\nPresumably your application already uses the default `log` package. To start throttling logs, you'll want your code to look like the following:\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"regexp\"\n\t\"time\"\n\n\t\"github.com/kyslik/gaglog\"\n)\n\nfunc main() {\n\tfilter := \u0026gaglog.GagFilter{\n\t\tWriter: os.Stderr,\n\t\tGags: gaglog.Gags{\n\t\t\tregexp.MustCompile(\"P([a-z]+)ch\"): time.Millisecond * 100,\n\t\t\tregexp.MustCompile(\"L([a-z]+)ch\"): time.Millisecond * 1000,\n\t\t\tregexp.MustCompile(\"F([a-z]+)ch\"): time.Millisecond * 10000,\n\t\t},\n\t}\n\n\tlog.SetOutput(filter)\n\n\tfor i := 0; i \u003c 1000000; i++ {\n\t\tlog.Print(\"Pinch\")\n\t\tlog.Print(\"Lynch\")\n\t\tlog.Print(\"Flinch\")\n\t\tif i % 100000 == 0 {\n\t\t\tlog.Print(\"Grinch\")\n\t\t}\n\t}\n\ttime.Sleep(5 * time.Second)\n\tlog.Println(\"Clinch\")\n}\n```\n\nThis logs to standard error exactly like Go's standard logger. Any log messages that are not matched by a regex, won't be gaged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyslik%2Fgaglog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyslik%2Fgaglog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyslik%2Fgaglog/lists"}