-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Level to common * Add Marker to common * Move MarkerFactory to common * add sfl4j methods to logger * rename package mu to io.github.oshai * update kotlin to 1.8.0 * change slf4j dep for compile only * move methods to Slf4jExtensions.kt * add jul activate with -Dkotlin-logging-to-jul * add jul impl * add jul test * remove jcenter * fix windows test * add github-release-4.x to github actions * change package to io.github.oshai * change group (coordinate) to io.github.oshai * change pom name * change maven url * change url according to https://central.sonatype.org/publish/publish-gradle/#review-requirements * bump version to 4.0.0-beta-10
- Loading branch information
Showing
80 changed files
with
2,121 additions
and
747 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
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
jcenter() | ||
} | ||
} | ||
|
||
|
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,7 @@ | ||
package io.github.oshai | ||
|
||
/** A platform independent factory to create markers. */ | ||
public object KMarkerFactory { | ||
|
||
public fun getMarker(name: String): io.github.oshai.Marker = io.github.oshai.SimpleMarker(name) | ||
} |
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,39 @@ | ||
package io.github.oshai | ||
|
||
public enum class Level(private val levelInt: Int, private val levelStr: String) { | ||
TRACE(io.github.oshai.Levels.TRACE_INT, "TRACE"), | ||
DEBUG(io.github.oshai.Levels.DEBUG_INT, "DEBUG"), | ||
INFO(io.github.oshai.Levels.INFO_INT, "INFO"), | ||
WARN(io.github.oshai.Levels.WARN_INT, "WARN"), | ||
ERROR(io.github.oshai.Levels.ERROR_INT, "ERROR"), | ||
; | ||
|
||
public fun toInt(): Int { | ||
return levelInt | ||
} | ||
|
||
/** Returns the string representation of this Level. */ | ||
override fun toString(): String { | ||
return levelStr | ||
} | ||
} | ||
|
||
public object Levels { | ||
|
||
public const val TRACE_INT: Int = 0 | ||
public const val DEBUG_INT: Int = 10 | ||
public const val INFO_INT: Int = 20 | ||
public const val WARN_INT: Int = 30 | ||
public const val ERROR_INT: Int = 40 | ||
|
||
public fun intToLevel(levelInt: Int): io.github.oshai.Level { | ||
return when (levelInt) { | ||
io.github.oshai.Levels.TRACE_INT -> io.github.oshai.Level.TRACE | ||
io.github.oshai.Levels.DEBUG_INT -> io.github.oshai.Level.DEBUG | ||
io.github.oshai.Levels.INFO_INT -> io.github.oshai.Level.INFO | ||
io.github.oshai.Levels.WARN_INT -> io.github.oshai.Level.WARN | ||
io.github.oshai.Levels.ERROR_INT -> io.github.oshai.Level.ERROR | ||
else -> throw IllegalArgumentException("Level integer [$levelInt] not recognized.") | ||
} | ||
} | ||
} |
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,11 @@ | ||
package io.github.oshai | ||
|
||
/** A platform independent marker to enrich log statements. */ | ||
public interface Marker { | ||
|
||
public fun getName(): String | ||
} | ||
|
||
internal data class SimpleMarker(private val name: String) : io.github.oshai.Marker { | ||
override fun getName(): String = this.name | ||
} |
2 changes: 1 addition & 1 deletion
2
...Main/kotlin/mu/internal/MessageInvoker.kt → ...o/github/oshai/internal/MessageInvoker.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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/commonTest/kotlin/mu/SimpleTest.kt → ...Test/kotlin/io/github/oshai/SimpleTest.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
2 changes: 1 addition & 1 deletion
2
.../kotlin/mu/internal/MessageInvokerTest.kt → ...thub/oshai/internal/MessageInvokerTest.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package mu.internal | ||
package io.github.oshai.internal | ||
|
||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
2 changes: 1 addition & 1 deletion
2
...n/kotlin/mu/KotlinLoggingConfiguration.kt → ...ithub/oshai/KotlinLoggingConfiguration.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package mu | ||
package io.github.oshai | ||
|
||
public actual val DefaultAppender: Appender = OSLogAppender() |
2 changes: 1 addition & 1 deletion
2
src/darwinMain/kotlin/mu/OSLogAppender.kt → ...n/kotlin/io/github/oshai/OSLogAppender.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package mu | ||
package io.github.oshai | ||
|
||
import kotlinx.cinterop.ptr | ||
import platform.darwin.OS_LOG_DEFAULT | ||
|
2 changes: 1 addition & 1 deletion
2
...nMain/kotlin/mu/OSLogSubsystemAppender.kt → ...io/github/oshai/OSLogSubsystemAppender.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
2 changes: 1 addition & 1 deletion
2
src/jsMain/kotlin/mu/Appender.kt → ...jsMain/kotlin/io/github/oshai/Appender.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package mu | ||
package io.github.oshai | ||
|
||
public interface Appender { | ||
public fun trace(message: Any?) | ||
|
2 changes: 1 addition & 1 deletion
2
...jsMain/kotlin/mu/ConsoleOutputAppender.kt → .../io/github/oshai/ConsoleOutputAppender.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
17 changes: 7 additions & 10 deletions
17
...Main/kotlin/mu/DefaultMessageFormatter.kt → ...o/github/oshai/DefaultMessageFormatter.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
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,14 @@ | ||
package io.github.oshai | ||
|
||
public interface Formatter { | ||
public fun formatMessage(level: Level, loggerName: String, msg: () -> Any?): Any? | ||
public fun formatMessage(level: Level, loggerName: String, t: Throwable?, msg: () -> Any?): Any? | ||
public fun formatMessage(level: Level, loggerName: String, marker: Marker?, msg: () -> Any?): Any? | ||
public fun formatMessage( | ||
level: Level, | ||
loggerName: String, | ||
marker: Marker?, | ||
t: Throwable?, | ||
msg: () -> Any? | ||
): Any? | ||
} |
Oops, something went wrong.