From 8dc96f708ecbf9c9376851534500a0b0822f4f50 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 30 Jul 2022 15:12:46 +0600 Subject: [PATCH] fixes --- src/commonMain/kotlin/filter/FilterKSLog.kt | 6 +----- src/commonMain/kotlin/filter/FilteredExtension.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 src/commonMain/kotlin/filter/FilteredExtension.kt diff --git a/src/commonMain/kotlin/filter/FilterKSLog.kt b/src/commonMain/kotlin/filter/FilterKSLog.kt index 9f1ce1a..d369a6c 100644 --- a/src/commonMain/kotlin/filter/FilterKSLog.kt +++ b/src/commonMain/kotlin/filter/FilterKSLog.kt @@ -2,7 +2,7 @@ package dev.inmo.kslog.common.filter import dev.inmo.kslog.common.* -class FilterLogger( +class FilterKSLog( private val fallbackLogger: KSLog, private val messageFilter: MessageFilter ) : KSLog { @@ -30,7 +30,3 @@ class FilterLogger( } } } - -fun KSLog.filtered( - filter: MessageFilter -) = FilterLogger(this, filter) diff --git a/src/commonMain/kotlin/filter/FilteredExtension.kt b/src/commonMain/kotlin/filter/FilteredExtension.kt new file mode 100644 index 0000000..443ea50 --- /dev/null +++ b/src/commonMain/kotlin/filter/FilteredExtension.kt @@ -0,0 +1,8 @@ +package dev.inmo.kslog.common.filter + +import dev.inmo.kslog.common.KSLog +import dev.inmo.kslog.common.MessageFilter + +fun KSLog.filtered( + filter: MessageFilter +) = FilterKSLog(this, filter)