add new KSLog factory

This commit is contained in:
InsanusMokrassar 2022-06-07 22:00:32 +06:00
parent afad845108
commit c48ceefd8a

View File

@ -44,7 +44,14 @@ expect fun KSLog(
fun KSLog( fun KSLog(
defaultTag: String, defaultTag: String,
levels: Set<LogLevel> = LogLevel.values().toSet() levels: Set<LogLevel>
): KSLog = KSLog (defaultTag) { l, _, _, _ -> ): KSLog = KSLog (defaultTag) { l, _, _, _ ->
l in levels l in levels
} }
fun KSLog(
defaultTag: String,
minLoggingLevel: LogLevel = LogLevel.VERBOSE
): KSLog = KSLog (defaultTag) { l, _, _, _ ->
minLoggingLevel.ordinal <= l.ordinal
}