{"id":15030653,"url":"https://github.com/google/flogger","last_synced_at":"2025-10-04T11:57:42.272Z","repository":{"id":41487035,"uuid":"129283853","full_name":"google/flogger","owner":"google","description":"A Fluent Logging API for Java","archived":false,"fork":false,"pushed_at":"2025-10-01T18:54:00.000Z","size":1277,"stargazers_count":1469,"open_issues_count":53,"forks_count":126,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-10-02T11:30:30.418Z","etag":null,"topics":["logging"],"latest_commit_sha":null,"homepage":"","language":"Java","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/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-12T16:52:52.000Z","updated_at":"2025-10-01T18:54:02.000Z","dependencies_parsed_at":"2023-02-16T21:15:59.565Z","dependency_job_id":"998fe820-5b4c-4c50-ad64-1a3a0ab86d57","html_url":"https://github.com/google/flogger","commit_stats":{"total_commits":315,"total_committers":45,"mean_commits":7.0,"dds":0.6095238095238096,"last_synced_commit":"febddca2a4280f375c00c56789471119e2157c30"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/google/flogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fflogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fflogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fflogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fflogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/flogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fflogger/sbom","scorecard":{"id":436915,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/flogger","commit":"2c7d806b08217993fea229d833a6f8b748591b45"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.6,"checks":[{"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":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.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":"Maintained","score":3,"reason":"3 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":10,"reason":"all dependencies are pinned","details":["Info:   3 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   1 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":"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":"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":"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 26 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-19T04:54:39.812Z","repository_id":41487035,"created_at":"2025-08-19T04:54:39.816Z","updated_at":"2025-08-19T04:54:39.816Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278308622,"owners_count":25965654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["logging"],"created_at":"2024-09-24T20:13:58.115Z","updated_at":"2025-10-04T11:57:42.248Z","avatar_url":"https://github.com/google.png","language":"Java","funding_links":[],"categories":["Uncategorized","日志库","others"],"sub_categories":["Uncategorized"],"readme":"# Flogger: A Fluent Logging API for Java\n[![Maven Central](https://img.shields.io/maven-central/v/com.google.flogger/flogger.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.google.flogger%22%20AND%20a:%22flogger%22\u0026core=gav) [![Javadocs](https://javadoc.io/badge/com.google.flogger/flogger.svg)](https://javadoc.io/doc/com.google.flogger/flogger) [![CI](https://github.com/google/flogger/workflows/CI/badge.svg?branch=master)](https://github.com/google/flogger/actions)\n\n## What is it?\n\nFlogger is a [fluent](http://en.wikipedia.org/wiki/Fluent_interface) logging API\nfor Java. It supports a wide variety of features, and has **[many benefits]**\nover existing logging APIs.\n\nCome for more self-documenting log statements:\n\n```java\nlogger.atInfo().withCause(exception).log(\"Log message with: %s\", argument);\n```\n\nStay for additional features that help you manage your logging better:\n\n```java\nlogger.atSevere()\n    .atMostEvery(30, SECONDS)\n    .log(\"Value: %s\", lazy(() -\u003e doExpensiveCalculation()));\n```\n\n## Benefits\n\nWhile some users prefer \"fluency\" as a style, this is not what the argument for\nFlogger rests on. Flogger offers these key, concrete advantages over other\nlogging APIs:\n\n*   Logging at disabled levels is [effectively free]. Finally, you can add as\n    many fine-grained log statements to your code as you want, without worry.\n*   Flogger also has very high [performance] for enabled log statements.\n*   A fluent API accommodates a variety of [present and future\n    features][extensibility] without combinatorial explosion, and without\n    requiring separate logging façades.\n*   Less reliance on long parameter lists makes it harder to misuse and yields\n    more [self-documenting][readability] code.\n\n## Yet another logging API?\n\nThe field of open-source Java logging APIs is already extremely crowded, so why\nadd another?\n\nTo paraphrase Douglas Adams \"Google's codebase is big. Really big. You just\nwon’t believe how vastly hugely [mind-bogglingly\nbig](https://cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository)\nit is\". Inevitably this resulted in many different debug logging APIs being used\nthroughout the Java codebase, each with its own benefits and issues. Developers\nwere forced to switch between APIs as they worked on different projects, and\ndifferences between APIs caused confusion and bugs.\n\nFlogger is the result of an attempt to create a unified logging API, suitable\nfor the vast majority of Java projects in Google.\n\nFor something of this magnitude it would have been preferable to use an\nexisting logging API, rather than creating and maintaining our own. However, the\nJava Core Libraries Team (i.e. Guava maintainers) concluded that Flogger was not\nslightly better than the alternatives, but much better.\n\nBy switching the majority of Java code in Google to use Flogger, many thousands\nof bugs have been fixed and the cost to developers of learning new logging APIs\nas they move through the codebase has been eliminated. Flogger is now the sole\nrecommended Java logging API within Google.\n\n## How to use Flogger\n\n### 1. Add the dependencies on Flogger\n\nAll code that uses flogger should depend on\n`com.google.flogger:flogger:\u003cversion\u003e` and\n`com.google.flogger:flogger-system-backend:\u003cversion\u003e`.\n\n\u003e Note: the dependency on `flogger-system-backend` is only required to be\nincluded when the binary is run. If you have a modularized build, you can\ninclude this dependency by the root module that builds your app/binary, and can\nbe `runtime` scope.\n\n\u003c!-- TODO(dbeaumont): link to docs for how to specify a backend. --\u003e\n\n### 2. Add an import for [`FluentLogger`]\n\n```java\nimport com.google.common.flogger.FluentLogger;\n```\n\n### 3. Create a `private static final` instance\n\n```java\nprivate static final FluentLogger logger = FluentLogger.forEnclosingClass();\n```\n\n### 4. Start logging:\n\n```java\nlogger.atInfo().withCause(exception).log(\"Log message with: %s\", argument);\n```\n\nLog messages can use any of [Java's printf format\nspecifiers](https://docs.oracle.com/javase/9/docs/api/java/util/Formatter.html);\nsuch as `%s`, `%d`, `%016x` etc.\n\nNote that you may also see code and documentation that references the\n`GoogleLogger` class. This is a minor variant of the default `FluentLogger`\ndesigned for use in Google's codebase. The `FluentLogger` API is recommended for\nnon-Google code, since its API should remain more stable over time.\n\n\u003ca name=\"more-information\"\u003e\u003c/a\u003e\n## More information\n\nFlogger was designed and implemented by David Beaumont, with invaluable help\nfrom the Java Core Libraries Team and many other Googlers.\n\nIf you interested in a deeper dive into the rationale behind Flogger's API,\nplease see [Anatomy of an API][anatomy].\n\n*   [Stack Overflow](https://stackoverflow.com/questions/ask?tags=flogger)\n*   [Mailing list](https://groups.google.com/forum/#!forum/flogger-discuss)\n*   [File a bug](https://github.com/google/flogger/issues)\n\n[anatomy]: https://google.github.io/flogger/anatomy\n\u003c!-- TODO(ronshapiro): publish javadoc, and point to that instead of source files --\u003e\n[backend]: https://github.com/google/flogger/blob/master/api/src/main/java/com/google/common/flogger/backend/LoggerBackend.java\n[effectively free]: https://google.github.io/flogger/benefits#cheap-disabled-logging\n[extensibility]: https://google.github.io/flogger/benefits#extensibility\n[`FluentLogger`]: https://github.com/google/flogger/blob/master/api/src/main/java/com/google/common/flogger/FluentLogger.java\n[many benefits]: https://google.github.io/flogger/benefits\n[performance]: https://google.github.io/flogger/benefits#performance\n[readability]: https://google.github.io/flogger/benefits#readability\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fflogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fflogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fflogger/lists"}