{"id":43492779,"url":"https://github.com/sergejsha/logger","last_synced_at":"2026-02-03T10:16:27.687Z","repository":{"id":247852018,"uuid":"826863634","full_name":"sergejsha/logger","owner":"sergejsha","description":"Minimalistic, fast and configurable Logger for Kotlin Multiplatform.","archived":false,"fork":false,"pushed_at":"2025-12-21T18:38:30.000Z","size":880,"stargazers_count":64,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-23T06:21:29.685Z","etag":null,"topics":["kotlin-multiplatform","logging-library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/sergejsha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-10T14:27:34.000Z","updated_at":"2025-12-21T18:38:35.000Z","dependencies_parsed_at":"2024-08-11T10:25:47.588Z","dependency_job_id":"20061edb-e2ae-4ca2-a048-adbf86fd1ee7","html_url":"https://github.com/sergejsha/logger","commit_stats":null,"previous_names":["sergejsha/logger"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sergejsha/logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergejsha","download_url":"https://codeload.github.com/sergejsha/logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergejsha%2Flogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29041057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"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":["kotlin-multiplatform","logging-library"],"created_at":"2026-02-03T10:16:26.948Z","updated_at":"2026-02-03T10:16:27.680Z","avatar_url":"https://github.com/sergejsha.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](http://img.shields.io/maven-central/v/de.halfbit/logger.svg)](https://central.sonatype.com/artifact/de.halfbit/logger)\n![maintenance-status](https://img.shields.io/badge/maintenance-passively--maintained-yellowgreen.svg)\n\n# 🪵 Logger\n\nMinimalistic and concise Logger for Kotlin Multiplatform from one of my projects,\nshared with the awesome Kotlin community.\n\n# Architecture\n\n\u003cimg src=\"http://www.plantuml.com/plantuml/proxy?cache=no\u0026src=https://raw.githubusercontent.com/sergejsha/logger/master/documentation/architecture.v3.iuml\"\u003e\n\n# Usage\n\n```kotlin\n// Initialize\nclass App : Application() {\n    override fun onCreate() {\n        initializeLogger {\n            registerPrintlnSink() // used by default if no sinks are configured\n            registerMemoryRingSink()\n            registerAndroidLogSink()\n            loggableLevel = if (isDebugBuild) Everything else InfoAndSevere\n        }\n    }\n}\n\n// Use logger\nprivate const val TAG = \"Reader\"\n\nclass Reader(private val bufferSize: Int) {\n\n    init {\n        i(TAG) { \"created: size=$bufferSize\" } // info\n        d(TAG) { \"created: size=$bufferSize\" } // debug\n    }\n\n    suspend fun readData() {\n        try {\n            httpClient.get(\"read-data\")\n        } catch (e: Exception) {\n            w(TAG, e) { \"data reading failed\" } // warning\n            e(TAG, e) // error\n        }\n    }\n}\n```\n\n## iOS usage\n\n```swift\ninit() {\n    LogKt.initializeLogger { builder in\n        builder.registerIosLogSink(logPrinter: LogPrinterCompanion.shared.Default)\n    }\n}\n\nprivate let TAG = \"SampleApp\"\nLogKt.d(tag: TAG) {\n    \"debug message\"\n}\n```\n\n![iOS log](https://raw.githubusercontent.com/sergejsha/logger/master/documentation/examples/iOS.png)\n\n## Android usage\n\n```kotlin\noverride fun onCreate() {\n    initializeLogger {\n        registerAndroidLogSink()\n    }\n}\n```\n\n![Android log](https://raw.githubusercontent.com/sergejsha/logger/master/documentation/examples/android.png)\n\n## Desktop usage\n\n```kotlin\nfun main() {\n    initializeLogger {\n        registerPrintlnSink()\n    }\n}\n```\n\n![Desktop log](https://raw.githubusercontent.com/sergejsha/logger/master/documentation/examples/desktop.png)\n\n## Browser usage\n\n```kotlin\nfun main() {\n    initializeLogger {\n        registerConsoleLogSink()\n    }\n}\n```\n\n![Browser log](https://raw.githubusercontent.com/sergejsha/logger/master/documentation/examples/jsBrowser.png)\n\n# How to\n\n## Disable logger for a class\n\n```kotlin\n// Create a named tag instance instead of a string-tag\nprivate val tag = namedTag(\"ScaleAnimation\")\n\n// Use the tag in log-functions\nd(tag) { \"animation started\" }\nd(tag) { \"scale: ${scale.value}\" }\n...\n\n// Set a loggable level to disable unwanted logs for this tag\nprivate val tag = namedTag(\"ScaleAnimation\", LoggableLevel.Nothing)\n```\n\n## Use class name for tags\n\n```kotlin\nclass Reader {\n    private val tag = classTag\u003cReader\u003e()\n\n    init {\n        d(tag) { \"created\" }\n    }\n}\n```\n\n# How to use it in my project?\n\nIn `gradle/libs.versions.toml`\n\n```toml\n[versions]\nkotlin = \"2.3.0\"\nlogger = \"0.10\"\n\n[libraries]\nlogger = { module = \"de.halfbit:logger\", version.ref = \"logger\" }\n\n[plugins]\nkotlin-multiplatform = { id = \"org.jetbrains.kotlin.multiplatform\", version.ref = \"kotlin\" }\n```\n\nIn `shared/build.gradle.kts`\n\n```kotlin\nplugins {\n    alias(libs.plugins.kotlin.multiplatform)\n}\n\nkotlin {\n    sourceSets {\n        commonMain.dependencies {\n            implementation(libs.logger)\n        }\n    }\n}\n```\n\n# Publish to maven Central\n\n1. Bump version in `build.gradle.kts` of the root project\n2. `./gradlew clean build releaseToMavenCentral`\n\n# License\n\n```\nCopyright 2024-2026 Sergej Shafarenka, www.halfbit.de\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergejsha%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergejsha%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergejsha%2Flogger/lists"}