Skip to content

Commit

Permalink
use logback for logging in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
levkhomich committed Oct 3, 2015
1 parent 1dd343d commit 9bad03c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
16 changes: 16 additions & 0 deletions core/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<logger name="akka.event" level="WARN"/>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<withJansi>true</withJansi>
<encoder>
<pattern>%date %-35(%highlight(%-5level) %logger{0}) %msg%n</pattern>
</encoder>
</appender>


<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
3 changes: 3 additions & 0 deletions core/src/test/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
akka {
extensions = ["com.github.levkhomich.akka.tracing.TracingExtension"]

loggers = ["akka.event.slf4j.Slf4jLogger"]
loggers += "com.github.levkhomich.akka.tracing.TracingLogger"

loglevel = "DEBUG"

# actor.default-mailbox {
# mailbox-type = "com.github.levkhomich.akka.tracing.TracingUnboundedMailbox"
# }
Expand Down
4 changes: 3 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ object Dependencies {
val playTest = "com.typesafe.play" %% "play-test" % PlayVersion % "test"
val akkaTest = "com.typesafe.akka" %% "akka-testkit" % AkkaVersion % "test"
val akkaRemote = "com.typesafe.akka" %% "akka-remote" % AkkaVersion % "test"
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % AkkaVersion % "test"
val logback = "ch.qos.logback" % "logback-classic" % "1.1.3" % "test"
}

val akka = Seq(Compile.akkaActor, Compile.akkaAgent, Compile.akkaStream, Compile.config)
Expand All @@ -231,5 +233,5 @@ object Dependencies {

def test(scalaVersion: String): Seq[ModuleID] =
Seq(Test.specs, Test.finagle, Test.playTest, Test.akkaTest,
Test.akkaRemote, Test.sprayTestkit(scalaVersion))
Test.akkaRemote, Test.sprayTestkit(scalaVersion), Test.akkaSlf4j, Test.logback)
}

0 comments on commit 9bad03c

Please sign in to comment.