{"id":37020980,"url":"https://github.com/medly/ktee","last_synced_at":"2026-01-14T02:27:42.102Z","repository":{"id":41502835,"uuid":"234463826","full_name":"medly/ktee","owner":"medly","description":"🚰 Tee for Kotlin","archived":false,"fork":false,"pushed_at":"2022-11-19T15:17:00.000Z","size":84,"stargazers_count":24,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-28T19:14:32.808Z","etag":null,"topics":["debugging","kotlin","logging","micro-library","pipelines","tee","utility"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/medly.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":"2020-01-17T03:35:35.000Z","updated_at":"2024-05-28T19:14:32.809Z","dependencies_parsed_at":"2023-01-21T20:17:16.453Z","dependency_job_id":null,"html_url":"https://github.com/medly/ktee","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/medly/ktee","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medly%2Fktee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medly%2Fktee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medly%2Fktee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medly%2Fktee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/medly","download_url":"https://codeload.github.com/medly/ktee/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/medly%2Fktee/sbom","scorecard":{"id":634484,"data":{"date":"2025-08-11","repo":{"name":"github.com/medly/ktee","commit":"d66ea6317ec9d846e2486caf24cb17e9ff6ad3ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/release.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":"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/build.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/medly/ktee/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/medly/ktee/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/medly/ktee/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/medly/ktee/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/medly/ktee/release.yml/master?enable=pin","Info:   0 out of   5 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: 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 '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-21T08:44:51.989Z","repository_id":41502835,"created_at":"2025-08-21T08:44:51.989Z","updated_at":"2025-08-21T08:44:51.989Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["debugging","kotlin","logging","micro-library","pipelines","tee","utility"],"created_at":"2026-01-14T02:27:41.487Z","updated_at":"2026-01-14T02:27:42.095Z","avatar_url":"https://github.com/medly.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KTee\n\n![Build](https://github.com/medly/ktee/workflows/Build/badge.svg)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=medly_ktee\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=medly_ktee)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=medly_ktee\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=medly_ktee)\n[![](https://jitpack.io/v/com.medly/ktee.svg)](https://jitpack.io/#com.medly/ktee)\n\nKTee is Tee for Kotlin code pipelines. If you love the unix command line `tee`, you know what we mean.\n\n![KTee](https://repository-images.githubusercontent.com/234463826/e1de5980-c09f-11ea-902f-7ebfca88e75a)\n\n\n\n\n## Why?\n\nOften times we need to break a perfect computation pipeline just to be able to log the intermediate values. For example, lets take a look at this code:\n\n```kotlin\n(1..10)\n    .filter { it % 2 == 0 }\n    .map { it * 2 }\n    .reduce(Int::plus)\n```\n\nIf we want to print the result of `filter` or `map` we need to either capture the result into an intermediate `val` or add a `.let { }` with logging statements.\n\nKTee simplifies printing intermediate values dramatically.\n\n## How?\n\nJust `.tee()` it. Seriously! Try this:\n\n```kotlin\n(1..10)\n    .filter { it % 2 == 0 }.tee()\n    .map { it * 2 }.tee()\n    .reduce(Int::plus).tee()\n```\n\nWhich produces following output on the console:\n\n```text\n[2, 4, 6, 8, 10]\n[4, 8, 12, 16, 20]\n60\n```\n\n## Can I Customize the output?\n\nWe can customize the way `tee` prints using markers and lambda blocks to return custom log messages.\n\n```kotlin\n(1..10)\n    .filter { it % 2 == 0 }.tee(\"even numbers: \")\n    .map { it * 2 }.tee(\"doubles \u003e\u003e\u003e\u003e\u003e \")\n    .reduce(Int::plus).tee {\"the result is $it\"}\n```               \n\nProduces:\n\n```\neven numbers: [2, 4, 6, 8, 10]\ndoubles \u003e\u003e\u003e\u003e\u003e [4, 8, 12, 16, 20]\nthe result is 60\n```\n\n## Can I tee to a `logger`?\n\nWe can also log to a custom logger instance (slf4j) instead of `stdout`\n\n```kotlin\n(1..10)\n    .filter { it % 2 == 0 }.teeToDebug(logger)\n    .map { it * 2 }.teeToTrace(logger)\n    .reduce(Int::plus).teeToInfo(logger) { \"the result is $it\" }\n```\n\nProduces:\n\n```\n[main] DEBUG ktee.KTeeTest - [2, 4, 6, 8, 10]\n[main] TRACE ktee.KTeeTest - [4, 8, 12, 16, 20]\n[main] INFO ktee.KTeeTest - the result is 60\n```\n\n\u003e This output was produced using `slf4j-simple` binding. Your output pattern may look different depending on logger's configuration\n\n## How do I add it to my project?\n\n`ktee` is available in [Maven Central](https://repo.maven.apache.org/maven2/com/medly/ktee/1.0.0/) 🎉\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'com.medly:ktee:1.0.0'\n}\n```        \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedly%2Fktee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedly%2Fktee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedly%2Fktee/lists"}