-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbbf1e9
commit cfce331
Showing
9 changed files
with
39 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
package com.ave.vastgui.appcompose.ui | ||
|
||
import android.os.Build | ||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
|
@@ -26,7 +27,7 @@ import org.slf4j.MarkerFactory | |
// Email: [email protected] | ||
// Date: 2024/10/12 | ||
|
||
class LoggerActivity: ComponentActivity() { | ||
class LoggerActivity : ComponentActivity() { | ||
|
||
private val mLogger = LoggerFactory.getLogger("LoggerActivity") | ||
|
||
|
@@ -44,16 +45,22 @@ class LoggerActivity: ComponentActivity() { | |
|
||
private fun dSimpleUsage() { | ||
val marker = MarkerFactory.getMarker("Marker") | ||
mLogger.debug(marker, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD_FORMAT_1, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD_FORMAT_2, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD_FORMAT_MORE, HELLO_WORLD, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD, Exception(HELLO_WORLD_EXCEPTION)) | ||
mLogger.debug(HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD_FORMAT_1, HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD_FORMAT_2, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD_FORMAT_MORE, HELLO_WORLD, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD, Exception(HELLO_WORLD_EXCEPTION)) | ||
if (false) { | ||
mLogger.debug(marker, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD_FORMAT_1, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD_FORMAT_2, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD_FORMAT_MORE, HELLO_WORLD, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(marker, HELLO_WORLD, Exception(HELLO_WORLD_EXCEPTION)) | ||
mLogger.debug(HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD_FORMAT_1, HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD_FORMAT_2, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD_FORMAT_MORE, HELLO_WORLD, HELLO_WORLD, HELLO_WORLD) | ||
mLogger.debug(HELLO_WORLD, Exception(HELLO_WORLD_EXCEPTION)) | ||
} | ||
mLogger.atDebug().log { | ||
Throwable().printStackTrace() | ||
HELLO_WORLD | ||
} | ||
} | ||
|
||
companion object { | ||
|
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 |
---|---|---|
|
@@ -29,14 +29,12 @@ import java.util.function.Supplier | |
// Author: Vast Gui | ||
// Email: [email protected] | ||
// Date: 2024/10/12 | ||
// Description: | ||
// Documentation: | ||
// Reference: | ||
// Documentation: https://ave.entropy2020.cn/documents/log/log-slf4j/usage/ | ||
|
||
/** | ||
* Slf4j event builder. | ||
* | ||
* @since 1.3.8 | ||
* @since 1.3.10 | ||
*/ | ||
internal class Slf4jEventBuilder( | ||
private val logcat: LogCat, | ||
|
@@ -91,7 +89,6 @@ internal class Slf4jEventBuilder( | |
|
||
|
||
override fun setMessage(messageSupplier: Supplier<String>?): LoggingEventBuilder = apply { | ||
@Suppress("NewApi") | ||
this.mMessage = messageSupplier?.get() | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -23,11 +23,12 @@ import org.slf4j.event.Level | |
// Author: Vast Gui | ||
// Email: [email protected] | ||
// Date: 2024/10/12 | ||
// Documentation: https://ave.entropy2020.cn/documents/log/log-slf4j/usage/ | ||
|
||
/** | ||
* Convert [Level] to [LogLevel]. | ||
* | ||
* @since 1.3.8 | ||
* @since 1.3.10 | ||
*/ | ||
fun convertLevel(level: Level?): LogLevel { | ||
return when (level) { | ||
|
@@ -43,7 +44,7 @@ fun convertLevel(level: Level?): LogLevel { | |
/** | ||
* Convert [Marker] to [Marker.getName] or [default]. | ||
* | ||
* @since 1.3.8 | ||
* @since 1.3.10 | ||
*/ | ||
fun convertMarker(marker: Marker?, default: String): String { | ||
if (marker == null) return default | ||
|
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