mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Update scribe, scribe-slf4j to 3.10.0
This commit is contained in:
committed by
eikek
parent
42081cc3b0
commit
0fa543121f
@ -12,6 +12,7 @@ import cats.effect.Sync
|
||||
import docspell.logging.{Level, LogEvent, Logger}
|
||||
|
||||
import scribe.LoggerSupport
|
||||
import scribe.data.{MDC, MDCMap}
|
||||
import scribe.message.LoggableMessage
|
||||
|
||||
private[logging] object ScribeWrapper {
|
||||
@ -38,13 +39,24 @@ private[logging] object ScribeWrapper {
|
||||
case Level.Trace => scribe.Level.Trace
|
||||
}
|
||||
|
||||
private[this] def emptyMDC: MDC =
|
||||
new MDCMap(None)
|
||||
|
||||
private[this] def convert(ev: LogEvent) = {
|
||||
val level = convertLevel(ev.level)
|
||||
val additional: List[LoggableMessage] = ev.additional.map {
|
||||
case Right(ex) => LoggableMessage.throwable2Message(ex)
|
||||
case Left(msg) => LoggableMessage.string2Message(msg)
|
||||
}.toList
|
||||
LoggerSupport(level, ev.msg() :: additional, ev.pkg, ev.fileName, ev.name, ev.line)
|
||||
LoggerSupport(
|
||||
level,
|
||||
ev.msg() :: additional,
|
||||
ev.pkg,
|
||||
ev.fileName,
|
||||
ev.name,
|
||||
ev.line,
|
||||
emptyMDC
|
||||
)
|
||||
.copy(data = ev.data.toDeferred)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user