Skip to content

Commit

Permalink
Introduce internalCompilerData field
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeme Praks committed Oct 27, 2024
1 parent 33a1351 commit 797b15d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ package io.github.oshai.kotlinlogging

public class KLoggingEventBuilder {
public var message: String? = null
public var messageTemplate: String? = null
public var cause: Throwable? = null
public var payload: Map<String, Any?>? = null
public var internalCompilerData: InternalCompilerData? = null

public class InternalCompilerData(
public val messageTemplate: String? = null,
public val className: String? = null,
public val methodName: String? = null,
public val lineNumber: Int? = null,
public val fileName: String? = null,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class LogbackLoggerWrapper(
fqcn = fqcn,
logger = underlyingLogger,
level = level.toLogbackLevel(),
message = messageTemplate ?: message,
message = internalCompilerData?.messageTemplate ?: message,
finalFormattedMessage = message,
throwable = cause,
argArray = emptyArray(),
Expand Down

0 comments on commit 797b15d

Please sign in to comment.