{"id":21424335,"url":"https://github.com/gomodules/union-logr","last_synced_at":"2026-01-03T16:09:04.570Z","repository":{"id":53927264,"uuid":"194835233","full_name":"gomodules/union-logr","owner":"gomodules","description":"A https://github.com/go-logr/logr implementation that aggregates multiple loggers","archived":false,"fork":false,"pushed_at":"2022-08-06T13:11:45.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T21:43:48.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/gomodules.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":"2019-07-02T09:43:34.000Z","updated_at":"2022-08-06T12:12:30.000Z","dependencies_parsed_at":"2022-08-13T04:40:21.666Z","dependency_job_id":null,"html_url":"https://github.com/gomodules/union-logr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomodules%2Funion-logr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomodules%2Funion-logr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomodules%2Funion-logr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomodules%2Funion-logr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gomodules","download_url":"https://codeload.github.com/gomodules/union-logr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933374,"owners_count":20370988,"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":[],"created_at":"2024-11-22T21:21:15.134Z","updated_at":"2026-01-03T16:09:04.528Z","avatar_url":"https://github.com/gomodules.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# union-logr\nA [logr](https://github.com/go-logr/logr) implementation that aggregates multiple loggers.\n\nUsage\n---\n\n### Code Example\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\n\t\"github.com/go-logr/glogr\"\n\tulogr \"gomodules.xyz/union-logr\"\n\t\"k8s.io/klog\"\n\t\"k8s.io/klog/klogr\"\n)\n\nfunc main(){\n\tflag.Set(\"logtostderr\", \"true\")\n\tflag.Parse()\n\tlogG := glogr.New().WithName(\"glog\")\n\n\tklog.InitFlags(flag.NewFlagSet(\"klog\", flag.ExitOnError))\n\tlogK := klogr.New().WithName(\"klog\")\n\n\tulog := ulogr.NewLogger(logG, logK).WithName(\"ulog\").WithValues(\"logr\", \"union-logr\")\n\tulog.V(0).Info(\"Example\", \"Key\", \"Value\")\n}\n\n```\n### Description\n\nFor using [union-logr](https://github.com/gomodules/union-logr), you just need to do the followings:\n\n- Define some logger (i.e.: `glogr`, `klogr` etc.)\n- Pass those logger to `ulogr.NewLogger` and use it like you are using a single logger.\n\nThus, you can use multiple loggers at a time using a single [union-logr](https://github.com/gomodules/union-logr). \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomodules%2Funion-logr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgomodules%2Funion-logr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomodules%2Funion-logr/lists"}