Implemented DefaultLoggerFactory to create platform specific logger
This commit is contained in:
parent
5083acc032
commit
2281d1758d
|
@ -0,0 +1,8 @@
|
||||||
|
package net.dankito.utils.multiplatform.log
|
||||||
|
|
||||||
|
|
||||||
|
expect class DefaultLoggerFactory() {
|
||||||
|
|
||||||
|
fun createDefaultLoggerFactory(): ILoggerFactory
|
||||||
|
|
||||||
|
}
|
|
@ -7,7 +7,11 @@ class LoggerFactory {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
var loggerFactory: ILoggerFactory = LogToConsoleLoggerFactory()
|
var loggerFactory: ILoggerFactory = createDefaultLoggerFactory()
|
||||||
|
|
||||||
|
private fun createDefaultLoggerFactory(): ILoggerFactory {
|
||||||
|
return DefaultLoggerFactory().createDefaultLoggerFactory()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun getLogger(name: String): Logger {
|
fun getLogger(name: String): Logger {
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package net.dankito.utils.multiplatform.log
|
||||||
|
|
||||||
|
|
||||||
|
actual class DefaultLoggerFactory {
|
||||||
|
|
||||||
|
actual fun createDefaultLoggerFactory(): ILoggerFactory {
|
||||||
|
return NSLogLoggerFactory()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue