forked from oshai/kotlin-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build failures after merge of oshai#119
- Loading branch information
Thad Cox
committed
Jul 16, 2020
1 parent
0225e78
commit efe15bc
Showing
5 changed files
with
45 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package mu | ||
|
||
/** | ||
* Factory for creating KLoggers | ||
*/ | ||
actual interface KLoggerFactory { | ||
actual fun logger(name: String): KLogger | ||
actual fun logger(func: () -> Unit): KLogger | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/linuxX64Main/kotlin/mu/internal/KLoggerFactoryDefault.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package mu.internal | ||
|
||
import mu.KLogger | ||
import mu.KLoggerFactory | ||
|
||
/** | ||
* factory methods to obtain a [KLogger] | ||
*/ | ||
@Suppress("NOTHING_TO_INLINE") | ||
internal actual object KLoggerFactoryDefault : KLoggerFactory { | ||
/** | ||
* get logger by explicit name | ||
*/ | ||
actual override fun logger(name: String): KLogger = KLoggerLinux(name) | ||
|
||
/** | ||
* get logger for the method, assuming it was declared at the logger file/class | ||
*/ | ||
actual override fun logger(func: () -> Unit): KLogger = logger(func::class.qualifiedName ?: "") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters