diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-01-31 09:01:18 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-01-31 09:01:18 -0300 |
commit | 49c426a635d10182e8a628353dfdf5510c4d9df2 (patch) | |
tree | a9b764090cbbf1c14973d3a3063fa776db53805d /kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala | |
parent | a0a57b110a3ee4876797ab51c4758525d166796f (diff) | |
download | Kamon-49c426a635d10182e8a628353dfdf5510c4d9df2.tar.gz Kamon-49c426a635d10182e8a628353dfdf5510c4d9df2.tar.bz2 Kamon-49c426a635d10182e8a628353dfdf5510c4d9df2.zip |
remake of trace context and allow different tracing levels
Diffstat (limited to 'kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala')
-rw-r--r-- | kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala b/kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala index d6648cef..a0d8e933 100644 --- a/kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala +++ b/kamon-core/src/test/scala/kamon/trace/instrumentation/ActorLoggingSpec.scala @@ -18,24 +18,24 @@ package kamon.trace.instrumentation import akka.testkit.TestKit import org.scalatest.{ Inspectors, Matchers, WordSpecLike } import akka.actor.{ Props, ActorLogging, Actor, ActorSystem } -import akka.event.Logging.{ LogEvent } -import kamon.trace.{ ContextAware, TraceContext, Trace } +import akka.event.Logging.LogEvent +import kamon.trace.{TraceContextAware, TraceRecorder} class ActorLoggingSpec extends TestKit(ActorSystem("actor-logging-spec")) with WordSpecLike with Matchers with Inspectors { "the ActorLogging instrumentation" should { "attach the TraceContext (if available) to log events" in { - val testTraceContext = Some(TraceContext(Actor.noSender, 1, "test", "test-1")) val loggerActor = system.actorOf(Props[LoggerActor]) system.eventStream.subscribe(testActor, classOf[LogEvent]) - Trace.withContext(testTraceContext) { + val testTraceContext = TraceRecorder.withNewTraceContext("logging") { loggerActor ! "info" + TraceRecorder.currentContext } fishForMessage() { case event: LogEvent if event.message.toString contains "TraceContext =>" ⇒ - val ctxInEvent = event.asInstanceOf[ContextAware].traceContext + val ctxInEvent = event.asInstanceOf[TraceContextAware].traceContext ctxInEvent === testTraceContext case event: LogEvent ⇒ false @@ -46,6 +46,6 @@ class ActorLoggingSpec extends TestKit(ActorSystem("actor-logging-spec")) with W class LoggerActor extends Actor with ActorLogging { def receive = { - case "info" ⇒ log.info("TraceContext => {}", Trace.context()) + case "info" ⇒ log.info("TraceContext => {}", TraceRecorder.currentContext) } } |