Skip to content

Commit

Permalink
Handle null logger name for acceptable check (#2145)
Browse files Browse the repository at this point in the history
* Handle null logger name for acceptable check

* Update logstage/logstage-core/.jvm/src/main/scala/izumi/logstage/adapter/jul/LogstageJulLogger.scala

---------

Co-authored-by: Kai <[email protected]>
  • Loading branch information
cholmes-axoni and neko-kai authored Jun 28, 2024
1 parent 55839fb commit c6f03dd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import scala.collection.compat.immutable.ArraySeq
class LogstageJulLogger(router: LogRouter) extends java.util.logging.Handler with JULTools with AutoCloseable {
override def publish(record: LogRecord): Unit = {
val level = toLevel(record)
if (router.acceptable(Log.LoggerId(record.getLoggerName), level)) {
val loggerName = record.getLoggerName match { case null => "null"; case s => s }
if (router.acceptable(Log.LoggerId(loggerName), level)) {
router.log(mkEntry(record))
}
}
Expand Down

0 comments on commit c6f03dd

Please sign in to comment.