{"id":13413302,"url":"https://github.com/no-src/log","last_synced_at":"2026-04-04T22:14:40.987Z","repository":{"id":39606536,"uuid":"406021705","full_name":"no-src/log","owner":"no-src","description":"A simple logging framework out of the box","archived":false,"fork":false,"pushed_at":"2025-11-24T06:23:36.000Z","size":123,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T00:24:05.890Z","etag":null,"topics":["go","log","logger","logging-framework"],"latest_commit_sha":null,"homepage":"","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/no-src.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":"2021-09-13T15:11:03.000Z","updated_at":"2025-11-24T06:23:32.000Z","dependencies_parsed_at":"2024-05-17T03:40:58.943Z","dependency_job_id":"12b0b635-b020-4c8d-88fc-280b462849af","html_url":"https://github.com/no-src/log","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/no-src/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/no-src","download_url":"https://codeload.github.com/no-src/log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Flog/sbom","scorecard":{"id":691244,"data":{"date":"2025-08-11","repo":{"name":"github.com/no-src/log","commit":"fc0377bce0fc7a087f4109390357bf917a69a4c8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"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":0,"reason":"Found 0/24 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":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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","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":"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/go.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/no-src/log/go.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party 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: Apache License 2.0: 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":"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":"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":"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":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 28 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-22T02:20:49.292Z","repository_id":39606536,"created_at":"2025-08-22T02:20:49.292Z","updated_at":"2025-08-22T02:20:49.292Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31416761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"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","log","logger","logging-framework"],"created_at":"2024-07-30T20:01:37.213Z","updated_at":"2026-04-04T22:14:40.970Z","avatar_url":"https://github.com/no-src.png","language":"Go","readme":"# log\n\n[![Build](https://img.shields.io/github/actions/workflow/status/no-src/log/go.yml?branch=main)](https://github.com/no-src/log/actions)\n[![License](https://img.shields.io/github/license/no-src/log)](https://github.com/no-src/log/blob/main/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/no-src/log.svg)](https://pkg.go.dev/github.com/no-src/log)\n[![Go Report Card](https://goreportcard.com/badge/github.com/no-src/log)](https://goreportcard.com/report/github.com/no-src/log)\n[![codecov](https://codecov.io/gh/no-src/log/branch/main/graph/badge.svg?token=8Q20UR86EW)](https://codecov.io/gh/no-src/log)\n[![Release](https://img.shields.io/github/v/release/no-src/log)](https://github.com/no-src/log/releases)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n## Installation\n\n```bash\ngo get -u github.com/no-src/log\n```\n\n## Quick Start\n\nCurrent support following loggers\n\n- [Empty Logger](#empty-logger)\n- [Console Logger](#console-logger)\n- [File Logger](#file-logger)\n- [Multi Logger](#multi-logger)\n- [Sample Logger](#sample-logger)\n\nFor example, init a console logger, to write logs.\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\n\t\"github.com/no-src/log\"\n\t\"github.com/no-src/log/level\"\n)\n\nfunc main() {\n\t// init console logger as default logger\n\t// replace the line of code with any logger you need\n\tlog.InitDefaultLogger(log.NewConsoleLogger(level.DebugLevel))\n\n\tdefer log.Close()\n\n\ttext := \"hello world\"\n\t// use default logger to write logs\n\tlog.Debug(\"%s, test debug log\", text)\n\tlog.Info(\"%s, test info log\", text)\n\tlog.Warn(\"%s, test warn log\", text)\n\tlog.Error(errors.New(\"log err\"), \"%s, test error log\", text)\n\tlog.ErrorIf(errors.New(\"log err\"), \"%s, test error log\", text)\n\tlog.Log(\"%s, test log log\", text)\n}\n```\n\n## Logger\n\n### Empty Logger\n\nInit empty logger as default logger.\n\n```go\nlog.InitDefaultLogger(log.NewEmptyLogger())\n```\n\n### Console Logger\n\nInit console logger as default logger.\n\n```go\nlog.InitDefaultLogger(log.NewConsoleLogger(level.DebugLevel))\n```\n\n### File Logger\n\nInit file logger as default logger.\n\n```go\nif logger, err := log.NewFileLogger(level.DebugLevel, \"./logs\", \"default_\"); err == nil {\n    log.InitDefaultLogger(logger)\n} else {\n    log.Error(err, \"init file logger error\")\n}\n```\n\n### Multi Logger\n\nInit multi logger as default logger.\n\n```go\nif logger, err := log.NewFileLogger(level.DebugLevel, \"./logs\", \"multi_\"); err == nil {\n    log.InitDefaultLogger(log.NewMultiLogger(log.NewConsoleLogger(level.DebugLevel), logger))\n} else {\n    log.Error(err, \"init file logger error\")\n}\n```\n\n### Sample Logger\n\nInit console logger as default logger and set the sample rate, default is `1`.\n\n```go\nlog.InitDefaultLoggerWithSample(log.NewConsoleLogger(level.DebugLevel), 0.6)\n```\n\nUse default logger to write logs by random sampling.\n\n```go\ntext := \"hello world\"\nlog.DebugSample(\"[sample] %s, test debug log\", text)\nlog.InfoSample(\"[sample] %s, test info log\", text)\nlog.WarnSample(\"[sample] %s, test warn log\", text)\nlog.ErrorSample(errors.New(\"log err\"), \"[sample] %s, test error log\", text)\nlog.ErrorIfSample(errors.New(\"log err from ErrorIfSample\"), \"[sample] %s, test error log\", text)\n```","funding_links":[],"categories":["Logging","日志记录"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fno-src%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fno-src%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fno-src%2Flog/lists"}