{"id":34178794,"url":"https://github.com/kunitsucom/ilog.go","last_synced_at":"2026-04-01T23:01:50.391Z","repository":{"id":187494166,"uuid":"677013491","full_name":"kunitsucom/ilog.go","owner":"kunitsucom","description":"ilog.go is a simple logging interface library for Go.","archived":false,"fork":false,"pushed_at":"2024-08-05T02:36:21.000Z","size":119,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T00:42:36.682Z","etag":null,"topics":["go","golang","golang-library","golang-package","log","logger","logger-interface","logging"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/kunitsucom/ilog.go","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/kunitsucom.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-10T14:32:49.000Z","updated_at":"2024-06-04T18:54:33.000Z","dependencies_parsed_at":"2023-10-17T04:56:29.685Z","dependency_job_id":"82566b0d-7cc2-4d11-af5d-2e0a8c5171ed","html_url":"https://github.com/kunitsucom/ilog.go","commit_stats":null,"previous_names":["kunitsuinc/ilog","kunitsuinc/ilog.go","kunitsucom/ilog.go"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/kunitsucom/ilog.go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitsucom%2Filog.go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitsucom%2Filog.go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitsucom%2Filog.go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitsucom%2Filog.go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kunitsucom","download_url":"https://codeload.github.com/kunitsucom/ilog.go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunitsucom%2Filog.go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: 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","golang-library","golang-package","log","logger","logger-interface","logging"],"created_at":"2025-12-15T13:03:19.120Z","updated_at":"2026-04-01T23:01:50.382Z","avatar_url":"https://github.com/kunitsucom.png","language":"Go","readme":"# ilog.go\n\n[![license](https://img.shields.io/github/license/kunitsucom/ilog.go)](LICENSE)\n[![pkg](https://pkg.go.dev/badge/github.com/kunitsucom/ilog.go)](https://pkg.go.dev/github.com/kunitsucom/ilog.go)\n[![goreportcard](https://goreportcard.com/badge/github.com/kunitsucom/ilog.go)](https://goreportcard.com/report/github.com/kunitsucom/ilog.go)\n[![workflow](https://github.com/kunitsucom/ilog.go/workflows/go-lint/badge.svg)](https://github.com/kunitsucom/ilog.go/tree/main)\n[![workflow](https://github.com/kunitsucom/ilog.go/workflows/go-test/badge.svg)](https://github.com/kunitsucom/ilog.go/tree/main)\n[![codecov](https://codecov.io/gh/kunitsucom/ilog.go/branch/main/graph/badge.svg?token=4UML9FB7BX)](https://codecov.io/gh/kunitsucom/ilog.go)\n[![sourcegraph](https://sourcegraph.com/github.com/kunitsucom/ilog.go/-/badge.svg)](https://sourcegraph.com/github.com/kunitsucom/ilog.go)\n\n`ilog.go` is a simple logging interface library for Go. By defining only the logger interface `ilog.Logger`, users can easily swap out the underlying logging implementation without changing their application code.\n\n## Features\n\n- **Flexibility**: Allows users to choose or switch between different logging implementations.\n- **Simplicity**: Only defines the logging interface, leaving the choice of logging implementation to the user.\n\n## Interface\n\n`ilog.Logger` interface is defined here:\n\n- [ilog.go](ilog.go)\n\n## Reference Implementations\n\nWe provide reference implementations for a custom logger and some of the popular logging libraries:\n\n- [ilog_default_implementation.go](ilog_default_implementation.go): custom logger implementation (Default. You can use this as a blueprint to integrate other loggers)\n- [implementations/zap/zap.go](implementations/zap/zap.go): implementation for [go.uber.org/zap](https://github.com/uber-go/zap)\n- [implementations/zerolog/zerolog.go](implementations/zerolog/zerolog.go): implementation for [github.com/rs/zerolog](https://github.com/rs/zerolog)\n\n## Usage\n\nFirst, go get `ilog.go` in your Go application:\n\n```bash\ngo get -u github.com/kunitsucom/ilog.go\n```\n\nThen, define a variable of the `ilog.Logger` interface type and initialize it with your chosen logger implementation.\n\n For example, if using the default implementation:\n\n```go\nimport (\n    \"github.com/kunitsucom/ilog.go\"\n)\n\nfunc main() {\n    l := ilog.NewBuilder(ilog.DebugLevel, os.Stdout).Build()\n}\n```\n\nif zap:\n\n```bash\ngo get -u github.com/kunitsucom/ilog.go/implementations/zap\n```\n\n```go\nimport (\n    \"github.com/kunitsucom/ilog.go\"\n    \"go.uber.org/zap\"\n    ilogzap \"github.com/kunitsucom/ilog.go/implementations/zap\"\n)\n\nfunc main() {\n    l := ilogzap.New(ilog.DebugLevel, zap.NewProduction())\n}\n```\n\nif zerolog:\n\n```bash\ngo get -u github.com/kunitsucom/ilog.go/implementations/zerolog\n```\n\n```go\nimport (\n    \"github.com/kunitsucom/ilog.go\"\n    ilogzerolog \"github.com/kunitsucom/ilog.go/implementations/zerolog\"\n    \"github.com/rs/zerolog\"\n)\n\nfunc main() {\n    l := ilogzerolog.New(ilog.DebugLevel, zerolog.New(os.Stdout))\n}\n```\n\nNow, you can use the `l` as ilog.Logger for logging in your application:\n\n```go\nfunc main() {\n    l := ... // your chosen logger implementation\n\n    l.String(\"key\", \"value\").Infof(\"This is an info message\")\n    l.Err(err).Errorf(\"This is an error message\")\n}\n```\n\nIf you wish to switch to another logger, simply change the initialization of the `l` variable.\n\n## Implementing a Custom Logger\n\nIf the provided reference implementations do not meet your requirements, you can easily implement the `Logger` interface with your desired logging package. Ensure that your custom logger adheres to the methods defined in the `ilog.go` interface.\n\n## License\n\n[here.](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunitsucom%2Filog.go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkunitsucom%2Filog.go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunitsucom%2Filog.go/lists"}