{"id":37093384,"url":"https://github.com/birkirb/loggers","last_synced_at":"2026-01-14T11:21:27.617Z","repository":{"id":57482051,"uuid":"49610169","full_name":"birkirb/loggers","owner":"birkirb","description":"Abstract logging for Golang projects. A kind of log4go in the spirit of log4j","archived":false,"fork":false,"pushed_at":"2020-06-11T12:31:32.000Z","size":17,"stargazers_count":18,"open_issues_count":0,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-05T21:22:06.665Z","etag":null,"topics":["abstract-logger","go","golang","interface","log4go","log4j","logger","logging","logrus","revel"],"latest_commit_sha":null,"homepage":"https://gopkg.in/birkirb/loggers.v1","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/birkirb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-13T23:55:53.000Z","updated_at":"2024-03-01T08:39:57.000Z","dependencies_parsed_at":"2022-09-02T04:20:27.474Z","dependency_job_id":null,"html_url":"https://github.com/birkirb/loggers","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/birkirb/loggers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birkirb%2Floggers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birkirb%2Floggers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birkirb%2Floggers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birkirb%2Floggers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/birkirb","download_url":"https://codeload.github.com/birkirb/loggers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birkirb%2Floggers/sbom","scorecard":{"id":239681,"data":{"date":"2025-08-11","repo":{"name":"github.com/birkirb/loggers","commit":"2ec57cf2e3a4b2ca1a497e98e3f95741755ef550"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 3/15 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T06:27:42.387Z","repository_id":57482051,"created_at":"2025-08-17T06:27:42.388Z","updated_at":"2025-08-17T06:27:42.388Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28418266,"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":["abstract-logger","go","golang","interface","log4go","log4j","logger","logging","logrus","revel"],"created_at":"2026-01-14T11:21:26.880Z","updated_at":"2026-01-14T11:21:27.597Z","avatar_url":"https://github.com/birkirb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loggers : Golang Abstract Loggers\nloggers define an abstract and common logging interface in three flavors.\n\n[![GoDoc](https://godoc.org/gopkg.in/birkirb/loggers.v1?status.svg)](https://godoc.org/gopkg.in/birkirb/loggers.v1)\n[![Build Status](https://travis-ci.org/birkirb/loggers.svg?branch=master)](http://travis-ci.org/birkirb/loggers)\n\n## Inspiration\n\nIf you have been using Go for a while, you've probably been asking yourself: \"Why, oh why, wasn't the standard library logger made an interface!?\"\nOften was I faced with having to decide about what kind of logger I needed before I was ready to, wondering:\n\n  * Where's Golang's answer to log4j ?\n  * Is there a log4go or log4golang ?\n\nWell this package should help. Install and call `log.Info(\"Log all my stuff\")` and you're off and you can easily switch out loggers later with only a single line of code.\n\n## Design\n\nAll loggers are interfaces and should be declared and used as such. The actual implementations can vary and are easily switched out.\nThe main packages should have no external dependencies.\nSee [here](https://github.com/birkirb/loggers/blob/master/loggers.go).\n\n### Standard\nStandard interface is the same as used by the Go standard library `log` package. \n\n### Advanced\nA common pattern for level discrete loggers using `debug`, `info`, `warn` and `error` levels, along with those defined by the standard interface.\n\n### Contextual\nA superset of Advanced, adds contextual logging, such that lines can have a number of additional parameters set to provide clearer separation of message and context.\n\n## Installation\n\n    go get gopkg.in/birkirb/loggers.v1\n\n## Usage\n\nYou can choose between declaring one of the three interfaces above that best suits your needs, or use the built in Contextual interface directly with a default standard library logger implementation to do your bidding. You can switch out all the loggers later as long as they satisfy the right interface.\n\n### Direct\n\nYou can use the loggers interface as a drop in replacement for the standard library logger.\nJust change your import statement from `\"log\"` to `\"gopkg.in/birkirb/loggers.v1/log\"`.\nIt should work just the same and you can make use of advanced and contextual methods only if you so decide.\nYou can then easily switch out the log package implementation later with your own logger as long as it implements the Contextual interface.\n\n```Go\n    log.Infof(\"Logger is started\") // Defaults to stdout.\n    log.Logger = stdlib.NewLogger(fileWriter, \"\", log.LstdFlags)\n    log.Infof(\"Now logging to fileWriter\") // writes to fileWriter\n```\n\n### Embedded\n\nDeclare your own project logging interface.\n\n```Go\nimport (\n    \"log\"\n\n    \"gopkg.in/birkirb/loggers.v1\"\n)\n\nvar Logger loggers.Standard\n\nfunc init() {\n    Logger = log.New(writer, \"myapp\", log.LstdFlags)\n    Logger.Println(\"Logger is started\")\n}\n```\n\n### Mappers\n\nA few loggers have been mapped to the above interfaces and could thus be used with any of them.\nInstead of the using the Standard logger as above, we could use the standard logger much like a leveled logger.\n\n```Go\nimport (\n    \"gopkg.in/birkirb/loggers.v1\"\n    \"gopkg.in/birkirb/loggers.v1/mappers/stdlib\"\n)\n\nvar Logger loggers.Advanced\n\nfunc init() {\n    Logger = stdlib.NewDefaultLogger()\n    Logger.Info(\"Logger is started\")\n}\n```\n\nA level mapper exist to ease with implementing plugins/mappers for other loggers that don't naturally implement any of the designed interfaces. This can be found in the mappers package.\n\n## Existing mappers\n\n* [Revel](https://github.com/revel/revel/) [mapper](https://github.com/birkirb/loggers-mapper-revel/)\n* [Logrus](https://github.com/Sirupsen/logrus) [mapper](https://github.com/birkirb/loggers-mapper-logrus/)\n\n# Contributing\n\nAny new mappers for different Go logging solutions would be most welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirkirb%2Floggers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirkirb%2Floggers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirkirb%2Floggers/lists"}