{"id":13610809,"url":"https://github.com/michaelbull/kotlin-inline-logger","last_synced_at":"2025-10-09T09:41:36.969Z","repository":{"id":45605718,"uuid":"190911610","full_name":"michaelbull/kotlin-inline-logger","owner":"michaelbull","description":"A logger facilitating lazily-evaluated log calls via Kotlin's inline classes \u0026 functions.","archived":false,"fork":false,"pushed_at":"2024-01-23T13:09:01.000Z","size":544,"stargazers_count":90,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-10T23:04:50.660Z","etag":null,"topics":["inline","jvm","kotlin","logger","multiplatform","slf4j"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelbull.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-08T16:40:30.000Z","updated_at":"2025-06-20T14:24:43.000Z","dependencies_parsed_at":"2024-01-23T12:26:32.324Z","dependency_job_id":"2933977e-3b88-49fb-b900-2119d7fcd245","html_url":"https://github.com/michaelbull/kotlin-inline-logger","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/michaelbull/kotlin-inline-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbull%2Fkotlin-inline-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbull%2Fkotlin-inline-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbull%2Fkotlin-inline-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbull%2Fkotlin-inline-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelbull","download_url":"https://codeload.github.com/michaelbull/kotlin-inline-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelbull%2Fkotlin-inline-logger/sbom","scorecard":{"id":641000,"data":{"date":"2025-08-11","repo":{"name":"github.com/michaelbull/kotlin-inline-logger","commit":"3785a3ef36fd2dd4edf47c730c3c895664f6bfb9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml: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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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/ci.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/michaelbull/kotlin-inline-logger/ci.yaml/master?enable=pin","Info:   0 out of   8 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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC 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 '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"}}]},"last_synced_at":"2025-08-21T10:44:47.932Z","repository_id":45605718,"created_at":"2025-08-21T10:44:47.933Z","updated_at":"2025-08-21T10:44:47.933Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001119,"owners_count":26083022,"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-09T02:00:07.460Z","response_time":59,"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":["inline","jvm","kotlin","logger","multiplatform","slf4j"],"created_at":"2024-08-01T19:01:48.206Z","updated_at":"2025-10-09T09:41:36.923Z","avatar_url":"https://github.com/michaelbull.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# kotlin-inline-logger\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.michael-bull.kotlin-inline-logger/kotlin-inline-logger.svg)](https://search.maven.org/search?q=g:com.michael-bull.kotlin-inline-logger) [![CI Status](https://github.com/michaelbull/kotlin-inline-logger/workflows/ci/badge.svg)](https://github.com/michaelbull/kotlin-inline-logger/actions?query=workflow%3Aci) [![License](https://img.shields.io/github/license/michaelbull/kotlin-inline-logger.svg)](https://github.com/michaelbull/kotlin-inline-logger/blob/master/LICENSE)\n\nA logger facilitating lazily-evaluated log calls via Kotlin's inline [classes][inline-classes] \u0026 [functions][inline-functions].\n\n## Installation\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"com.michael-bull.kotlin-inline-logger:kotlin-inline-logger:1.0.6\")\n}\n```\n\n## Introduction\n\n`kotlin-inline-logger` has been structured as a [`multiplatform project`][mpp].\nCurrently the only implementation supports the JVM, utilising [SLF4J][slf4j],\nhowever in future other platforms can also be supported by implementing the\nnecessary platform-specific APIs found in [`src/commonMain`](src/commonMain).\n\nIf you would like to implement support for a platform, please don't hesitate\nto open a pull request on [GitHub][github].\n\n### JVM\n\nOn the JVM, `kotlin-inline-logger` provides inline functions that delegate\nto [SLF4J][slf4j]. Users migrating from an existing SLF4J solution will find\nexisting calls to logging functions like `logger.info(\"Example\")` now marked as\n`@Deprecated`, prompting them to replace their existing code with the\nlazily-evaluated alternatives.\n\n![ReplaceWith example](replacewith-example.gif)\n\n#### Creating loggers\n\nBy default, passing no argument when creating an `InlineLogger()` will utilise\n`MethodHandles.lookup()`, introduced in JDK7, to derive the name of the logger\nfrom the class that created it. This is described in SLF4J's documentation as\nan [idiomatic method of declaring a logger][slf4j-idiom] that is resistant to\ncut-and-paste errors:\n\n```kotlin\nclass TransactionExecutor {\n    val transactionLogger = InlineLogger() // named com.package.TransactionExecutor\n}\n```\n\nNamed loggers can be created by passing a `String`:\n\n```kotlin\nval transactionLogger = InlineLogger(\"DatabaseTransactions\")\n```\n\nClass loggers can be created by passing a `::class` reference:\n\n```kotlin\nclass TransactionExecutor\n\nval transactionLogger = InlineLogger(TransactionExecutor::class)\n```\n\n\n#### Effectiveness\n\nThe code examples below illustrate how the Kotlin you write is compiled to\ninteroperable Java, demonstrating how the `expensiveCalculation()` function is\nonly invoked and interpolated with the log message if warn-level logging is\nenabled.\n\nThis allows you to replace usages of SLF4J's [MessageFormatter][slf4j-formatter],\nwith the more idiomatic [string templates][string-templates] Kotlin provides.\n\n##### Kotlin:\n\n```kotlin\nimport com.github.michaelbull.logging.InlineLogger\n\nval logger = InlineLogger(\"CalculationLogger\")\n\nfun expensiveCalculation(): Int {\n    return 1234 * 5678\n}\n\nfun main() {\n    logger.warn { \"The result is: ${expensiveCalculation()}\" }\n}\n```\n\n##### Decompiled Java:\n\n```java\nimport com.github.michaelbull.logging.InlineLogger;\nimport org.jetbrains.annotations.NotNull;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\npublic final class ExampleKt {\n    @NotNull\n    private static final Logger logger;\n\n    @NotNull\n    public static Logger getLogger() {\n        return logger;\n    }\n\n    public static int expensiveCalculation() {\n        return 1234 * 5678;\n    }\n\n    public static void main() {\n        Logger $this$iv = logger;\n        if (InlineLogger.isWarnEnabled-impl((Logger) $this$iv)) {\n            String string = \"The result is: \" + ExampleKt.expensiveCalculation();\n            $this$iv.warn(String.valueOf(string));\n        }\n    }\n\n    public static /* synthetic */ void main(String[] arrstring) {\n        ExampleKt.main();\n    }\n\n    static {\n        Logger delegate$iv = LoggerFactory.getLogger(\"CalculationLogger\");\n        logger = InlineLogger.constructor-impl((Logger) delegate$iv);\n    }\n}\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on [GitHub][github].\n\n## License\n\nThis project is available under the terms of the ISC license. See the\n[`LICENSE`](LICENSE) file for the copyright information and licensing terms.\n\n[inline-classes]: https://kotlinlang.org/docs/reference/inline-classes.html\n[inline-functions]: https://kotlinlang.org/docs/reference/inline-functions.html\n[mpp]: https://kotlinlang.org/docs/reference/multiplatform.html\n[string-templates]: https://kotlinlang.org/docs/reference/basic-types.html#string-templates\n[github]: https://github.com/michaelbull/kotlin-inline-logger\n[slf4j]: https://www.slf4j.org/\n[slf4j-idiom]: https://www.slf4j.org/faq.html#declaration_pattern\n[slf4j-formatter]: https://www.slf4j.org/api/org/slf4j/helpers/MessageFormatter.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelbull%2Fkotlin-inline-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelbull%2Fkotlin-inline-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelbull%2Fkotlin-inline-logger/lists"}