{"id":38034640,"url":"https://github.com/ermanimer/log","last_synced_at":"2026-01-16T19:48:05.031Z","repository":{"id":49875157,"uuid":"374642178","full_name":"ermanimer/log","owner":"ermanimer","description":"Simple, customizable, leveled and efficient logging in Go","archived":false,"fork":false,"pushed_at":"2022-08-12T16:00:43.000Z","size":41,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-22T17:21:27.909Z","etag":null,"topics":["leveled-logging","logging"],"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/ermanimer.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":"2021-06-07T11:32:39.000Z","updated_at":"2023-06-01T14:25:03.000Z","dependencies_parsed_at":"2022-09-26T20:01:28.920Z","dependency_job_id":null,"html_url":"https://github.com/ermanimer/log","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ermanimer/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ermanimer","download_url":"https://codeload.github.com/ermanimer/log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Flog/sbom","scorecard":{"id":381508,"data":{"date":"2025-08-11","repo":{"name":"github.com/ermanimer/log","commit":"e94fe23001b4a884944009f2a193b6e1ce63bfaa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/25 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ermanimer/log/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/ermanimer/log/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"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":"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":"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 'main'"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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-18T15:33:25.238Z","repository_id":49875157,"created_at":"2025-08-18T15:33:25.238Z","updated_at":"2025-08-18T15:33:25.238Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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":["leveled-logging","logging"],"created_at":"2026-01-16T19:48:04.976Z","updated_at":"2026-01-16T19:48:05.024Z","avatar_url":"https://github.com/ermanimer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# log\n\n[![Go](https://github.com/ermanimer/log/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/ermanimer/log/actions/workflows/go.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/ermanimer/log)](https://goreportcard.com/report/github.com/ermanimer/log)\n\nSimple, customizable, leveled and efficient logging in Go\n\n# Installation\n\n```bash\ngo get -u github.com/ermanimer/log\n```\n\n# Features\n\n**log** is a simple logging package for Go. \n\n- You can set output\n- You can set internal error output (slog writes Log method's errors to internal error output instead of returning them.)\n- You can set time format and prefixes\n- You can set logging level to filter out log messages\n- You can set a hook function to be called after each log\n\n**log** isn't the fastest logging solution, but **log** is efficient while being customizable. Please see [benchmark tests](https://github.com/ermanimer/log#benchmark-tests).\n\n# Usage\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/ermanimer/log/v2\"\n)\n\nfunc main() {\n\t// create a new logger instance with output and default parameters\n\tl := log.NewLogger()\n\n\t// log a message\n\tl.Debug(\"this is a debug message\")\n\n\t// log a formatted message\n\tl.Debugf(\"this is a %s debug message\", \"formatted\")\n}\n```\n\n**Output:**\n\n```bash\n2021-06-07T16:46:26+03:00 debug this is a debug message\n2021-06-07T16:46:26+03:00 debug this is a formatted debug message\n```\n\n# Logging Levels\n\n - Debug\n - Info\n - Warning\n - Error\n - Fatal\n\n# Default Parameters:\n\n| Parameter | Value |\n|:----------|:-----:|\n|Output|os.Stdout|\n|Internal Error Output|os.Stderr|\n|Time Format|RFC3339|\n|Debug Prefix|debug|\n|Info Prefix|info|\n|Warning Prefix|warning|\n|Error Prefix|error|\n|Fatal Prefix|fatal|\n|Logging Level|Debug|\n\n# Set Output\n\n```go\nl.SetOutput(os.Stderr)\n```\n\n# Set Internal Error Output\n\n```go\nl.SetOutput(io.Discard)\n```\n\n# Set Logging Level\n\n```go\nl.SetLoggingLevel(InfoLevel)\n```\n\n# Set Time Format\n\n```go\nl.SetTimeFormat(time.RFC3339Nano)\n```\n\n# Set Prefixes\n\n```go\nl.SetDebugPrefix(\"DEB\")\nl.SetInfoPrefix(\"INF\")\nl.SetWarningPrefix(\"WAR\")\nl.SetErrorPrefix(\"ERR\")\nl.SetFatalPrefix(\"FAT\")\n```\n\n# Set Hook Function:\n\n```go\nl.SetHookFunction(func(prefix, message string) {\n  //you can filter messages with prefix and capture for Sentry.io\n})\n```\n\n# Benchmark Tests\n\n**Test Codes:**\n\n```go\nfunc BenchmarkDebug(b *testing.B) {\n\t// create logger\n\tl := NewLogger(ioutil.Discard)\n\n\t// start benchmark test\n\tb.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\tl.Debug(\"test\")\n\t\t}\n\t})\n}\n\nfunc BenchmarkDebugf(b *testing.B) {\n\t// create logger\n\tl := NewLogger(ioutil.Discard)\n\n\t// start benchmark test\n\tb.RunParallel(func(pb *testing.PB) {\n\t\tfor pb.Next() {\n\t\t\tl.Debugf(\"%s\", \"test\")\n\t\t}\n\t})\n}\n```\n**Results:**\n\n| Function | Time | Bytes Allocated | Objects Allocated |\n|:---------|:----:|:---------------:|:-----------------:|\n|Debug|410.7 ns/op|4 B/op|1 allocs/op|\n|Debugf|408.7 ns/op|4 B/op|1 allocs/op|\n|Info|404.0 ns/op|4 B/op|1 allocs/op|\n|Infof|403.9 ns/op|4 B/op|1 allocs/op|\n|Warning|407.0 ns/op|4 B/op|1 allocs/op|\n|Warningf|409.4 ns/op|4 B/op|1 allocs/op|\n|Error|404.6 ns/op|4 B/op|1 allocs/op|\n|Errorf|406.2 ns/op|4 B/op|1 allocs/op|\n|Fatal|402.1 ns/op |4 B/op|1 allocs/op|\n|Fatalf|406.0 ns/op|4 B/op|1 allocs/op|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermanimer%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fermanimer%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermanimer%2Flog/lists"}