{"id":13413308,"url":"https://github.com/mbndr/logo","last_synced_at":"2026-01-23T13:19:46.173Z","repository":{"id":57488301,"uuid":"81237818","full_name":"mbndr/logo","owner":"mbndr","description":"Golang logger to different configurable writers.","archived":false,"fork":false,"pushed_at":"2020-12-27T10:33:21.000Z","size":114,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-31T20:52:13.014Z","etag":null,"topics":["go-log","golang","golog","log","logger"],"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/mbndr.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":"2017-02-07T18:02:55.000Z","updated_at":"2022-09-26T23:23:24.000Z","dependencies_parsed_at":"2022-08-29T15:01:30.278Z","dependency_job_id":null,"html_url":"https://github.com/mbndr/logo","commit_stats":null,"previous_names":["probandula/logo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mbndr/logo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbndr%2Flogo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbndr%2Flogo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbndr%2Flogo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbndr%2Flogo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbndr","download_url":"https://codeload.github.com/mbndr/logo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbndr%2Flogo/sbom","scorecard":{"id":631089,"data":{"date":"2025-08-11","repo":{"name":"github.com/mbndr/logo","commit":"913ba85c52d9dd98cd3c1c006f49330c23ab60e6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/27 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 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"}},{"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"}}]},"last_synced_at":"2025-08-21T07:55:32.589Z","repository_id":57488301,"created_at":"2025-08-21T07:55:32.589Z","updated_at":"2025-08-21T07:55:32.589Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"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":["go-log","golang","golog","log","logger"],"created_at":"2024-07-30T20:01:37.353Z","updated_at":"2026-01-23T13:19:46.153Z","avatar_url":"https://github.com/mbndr.png","language":"Go","funding_links":[],"categories":["Logging","Relational Databases","日志","\u003cspan id=\"日志-logging\"\u003e日志 Logging\u003c/span\u003e","Logging 日志库","日志记录"],"sub_categories":["Advanced Console UIs","Search and Analytic Databases","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","SQL 查询语句构建库","检索及分析资料库"],"readme":"# Logo\n\n\nA simple logging library for golang.\n\n![banner](./banner.png)\n\nI wanted to have a logger that is easy configurable with various `io.Writers` and a simple active and color on / off switch, so I created it.\n\n[![Build Status](https://travis-ci.org/mbndr/logo.svg?branch=master)](https://travis-ci.org/mbndr/logo)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mbndr/logo)](https://goreportcard.com/report/github.com/mbndr/logo)\n[![Coverage](https://gocover.io/_badge/github.com/mbndr/logo)](https://gocover.io/github.com/mbndr/logo)\n[![cover.run go](https://cover.run/go/github.com/mbndr/logo.svg)](https://cover.run/go/github.com/mbndr/logo)\n[![GoDoc](https://godoc.org/github.com/mbndr/logo?status.svg)](https://godoc.org/github.com/mbndr/logo)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mbndr/logo/blob/master/LICENSE)\n\n## Explanation\nA `Logger` object can hold multiple `Receivers`. Every `Receiver` holds an `io.Writer` object (f.e. `os.File`, `os.Stderr`), a `Level` which is minimal the log level that is logged, a boolean `Active` which says if the `Receiver` should log or not, and a boolean `Color` which prints output colored if turned on. Every `Receiver` has also its own log format.\n\n## Initilization\n\nFirst you have to install the package.\n```\ngo get -u github.com/mbndr/logo\n```\nAfter that you can import it.\n```go\nimport \"github.com/mbndr/logo\"\n```\n\n### Simple\nIt's possible to create a simple logger with a `io.Writer`, the log level and a color boolean as parameter.\n```go\n// Create a simple cli logger with activated colors which logs everything\nlog := logo.NewSimpleLogger(os.Stderr, logo.DEBUG, \"prefix \", true)\n```\n\n### Advanced\nYou can create multiple `Receivers` and add it to a new `Logger`.\n```go\n// Receiver for the terminal which logs everything\ncliRec := logo.NewReceiver(os.Stderr, \"prefix \")\ncliRec.Color = true\ncliRec.Level = logo.DEBUG\n\n// Helper function to get a os.File with the correct options\nlogFile, _ := logo.Open(\"./example/logo.log\")\n\n// Receiver for the log file\n// This will log with level INFO (default) and have no colors activated\n// Also the log format is simpler (f.e. ERRO: Message)\nfileRec := logo.NewReceiver(logFile, \"prefix \")\nfileRec.Format = \"%s: %s\"\n\n// Create the logger\nlog := logo.NewLogger(cliRec, fileRec)\n```\n\n## Usage\nIf you created you `logo.Logger` object, there are a few methods you can use to log.\n```go\n// Methods which write like log.Println()\nlog.Debug(\"First debug\", \" and another string to log\")\nlog.Info(\"Information\")\nlog.Warn(\"Warning\", \" message\")\nlog.Error(\"Error message\")\nlog.Fatal(\"Fatal error\", \" because of something\")\n\n// Methods which write like log.Printf()\nlog.Debugf(\"Debug value %d\", 16)\nlog.Infof(\"Listening on port %d\", 8080)\nlog.Warnf(\"Invalid user %s\", user.Name)\nlog.Errorf(\"Couldn't load config file: %s\", path)\nlog.Fatalf(\"Fatal error: %s\", err.Error())\n\n// Disable the logger\nlog.Active = false\n```\n\n## Tests\nThere are a few unit tests written for this library. To run them `cd` into the project directory and run this.\n```\ngo test -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbndr%2Flogo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbndr%2Flogo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbndr%2Flogo/lists"}