KSLog with iterable

This commit is contained in:
InsanusMokrassar 2022-06-08 16:06:41 +06:00
parent 2b79b6d060
commit 63b29d3665
2 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,7 @@
## 0.0.2 ## 0.0.2
* New logger `TagLogger` and now extension `Any#logger` will use it to decrease objects allocations * New logger `TagLogger` and now extension `Any#logger` will use it to decrease objects allocations
* Now it is possible to create `KSLog` using any iterable
## 0.0.1 ## 0.0.1

View File

@ -44,9 +44,12 @@ expect fun KSLog(
fun KSLog( fun KSLog(
defaultTag: String, defaultTag: String,
levels: Set<LogLevel> levels: Iterable<LogLevel>
): KSLog = KSLog (defaultTag) { l, _, _, _ -> ): KSLog {
l in levels val levels = levels.toSet()
return KSLog (defaultTag) { l, _, _, _ ->
l in levels
}
} }
fun KSLog( fun KSLog(