This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko.git


The following commit(s) were added to refs/heads/main by this push:
     new 5a45fdf734 use slf4j v2 (#748)
5a45fdf734 is described below

commit 5a45fdf734e8f5cbd3a4b0b592dd085bce885e63
Author: PJ Fanning <[email protected]>
AuthorDate: Wed Oct 18 23:16:42 2023 +0100

    use slf4j v2 (#748)
    
    * use slf4j v2
    
    * Update StubbedActorContext.scala
    
    * deprecation warning
    
    * Update TestAppender.scala
---
 .../testkit/typed/internal/StubbedActorContext.scala     | 16 ++++++++++------
 .../actor/testkit/typed/internal/TestAppender.scala      |  4 +++-
 project/Dependencies.scala                               |  4 ++--
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git 
a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
 
b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
index 2f04ab5e59..51314acafc 100644
--- 
a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
+++ 
b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/StubbedActorContext.scala
@@ -21,7 +21,7 @@ import pekko.actor.{ ActorPath, ActorRefProvider, 
InvalidMessageException }
 import pekko.annotation.InternalApi
 import pekko.util.Helpers
 import pekko.{ actor => classic }
-import org.slf4j.Logger
+import org.slf4j.{ Logger, Marker }
 import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory }
 
 import java.util.concurrent.ThreadLocalRandom.{ current => rnd }
@@ -243,11 +243,15 @@ private[pekko] final class FunctionRef[-T](override val 
path: ActorPath, send: (
       .iterator()
       .asScala
       .map { evt =>
-        CapturedLogEvent(
-          level = evt.getLevel,
-          message = MessageFormatter.arrayFormat(evt.getMessage, 
evt.getArgumentArray).getMessage,
-          cause = Option(evt.getThrowable),
-          marker = Option(evt.getMarker))
+        {
+          val marker: Option[Marker] = 
Option(evt.getMarkers).flatMap(_.asScala.headOption)
+          CapturedLogEvent(
+            level = evt.getLevel,
+            message = MessageFormatter.arrayFormat(evt.getMessage, 
evt.getArgumentArray).getMessage,
+            cause = Option(evt.getThrowable),
+            marker = marker)
+
+        }
       }
       .toList
   }
diff --git 
a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala
 
b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala
index e0a956236d..d2d8609944 100644
--- 
a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala
+++ 
b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/internal/TestAppender.scala
@@ -16,6 +16,7 @@ package org.apache.pekko.actor.testkit.typed.internal
 import ch.qos.logback.classic.spi.ILoggingEvent
 import ch.qos.logback.classic.spi.ThrowableProxy
 import ch.qos.logback.core.AppenderBase
+import org.slf4j.Marker
 
 import org.apache.pekko
 import pekko.actor.testkit.typed.LoggingEvent
@@ -88,13 +89,14 @@ import pekko.annotation.InternalApi
       case _ => None
     }
 
+    val marker: Option[Marker] = 
Option(event.getMarkerList).flatMap(_.asScala.headOption)
     val loggingEvent = LoggingEvent(
       level = convertLevel(event.getLevel),
       message = event.getFormattedMessage,
       loggerName = event.getLoggerName,
       threadName = event.getThreadName,
       timeStamp = event.getTimeStamp,
-      marker = Option(event.getMarker),
+      marker = marker,
       throwable = throwable,
       mdc = event.getMDCPropertyMap.asScala.toMap)
 
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 1ce30be7ed..5df8569f77 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -22,7 +22,7 @@ object Dependencies {
     .withRank(KeyRanks.Invisible) // avoid 'unused key' warning
 
   val junitVersion = "4.13.2"
-  val slf4jVersion = "1.7.36"
+  val slf4jVersion = "2.0.9"
   // check agrona version when updating this
   val aeronVersion = "1.42.1"
   // needs to be inline with the aeron version, check
@@ -30,7 +30,7 @@ object Dependencies {
   val agronaVersion = "1.19.2"
   val nettyVersion = "4.1.100.Final"
   val protobufJavaVersion = "3.19.6"
-  val logbackVersion = "1.2.12"
+  val logbackVersion = "1.3.11"
 
   val jacksonCoreVersion = "2.14.3"
   val jacksonDatabindVersion = jacksonCoreVersion


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to