Skip to content

Commit

Permalink
fix(logger): log tag truncation fix (issue #317) (#325)
Browse files Browse the repository at this point in the history
Co-authored-by: Aastha <[email protected]>
  • Loading branch information
aasthajn and Aastha authored Sep 25, 2024
1 parent 1cd4d7b commit 5562cb7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ internal class LogsProcessor private constructor() {
}

private fun consolePrint(level: Level, tag: String, message: String, tr: Throwable?, trace: StackTrace) {
val logTag = "${trace.formattedStack()} | $tag"
val newMessage = StringBuilder().append(message).append("\n").append("[logged from: ${trace.formattedStack()}]").toString()
when (level) {
is Level.Debug -> Log.v(logTag, message, tr)
is Level.Error -> Log.e(logTag, message, tr)
is Level.Info -> Log.i(logTag, message, tr)
is Level.Warning -> Log.w(logTag, message, tr)
is Level.Verbose -> Log.v(logTag, message, tr)
is Level.WTF -> Log.wtf(logTag, message, tr)
is Level.Event -> Log.d(logTag, message)
is Level.Debug -> Log.v(tag, newMessage, tr)
is Level.Error -> Log.e(tag, newMessage, tr)
is Level.Info -> Log.i(tag, newMessage, tr)
is Level.Warning -> Log.w(tag, newMessage, tr)
is Level.Verbose -> Log.v(tag, newMessage, tr)
is Level.WTF -> Log.wtf(tag, newMessage, tr)
is Level.Event -> Log.d(tag, newMessage)
}
}

Expand Down

0 comments on commit 5562cb7

Please sign in to comment.