diff options
author | Diego <diegolparra@gmail.com> | 2016-07-10 17:56:25 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2016-07-10 17:56:25 -0300 |
commit | b4bd6588ad568d2c049b5473189858e487693e29 (patch) | |
tree | 2e07c1a1668e1a94e1c3589a9117071f5bf9c47a /kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala | |
parent | ef927dc672bea427d4de89b8d0ea0bd18bd71285 (diff) | |
download | Kamon-b4bd6588ad568d2c049b5473189858e487693e29.tar.gz Kamon-b4bd6588ad568d2c049b5473189858e487693e29.tar.bz2 Kamon-b4bd6588ad568d2c049b5473189858e487693e29.zip |
= core: minor refactor
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala b/kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala index 60a02ef8..c757027c 100644 --- a/kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala +++ b/kamon-core/src/main/scala/kamon/trace/logging/MdcKeysSupport.scala @@ -1,6 +1,6 @@ /* * ========================================================================================= - * Copyright © 2013-2014 the kamon project <http://kamon.io/> + * Copyright © 2013-2016 the kamon project <http://kamon.io/> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of the License at @@ -24,7 +24,6 @@ import org.slf4j.MDC trait MdcKeysSupport { val traceTokenKey = "traceToken" - val traceNameKey = "traceName" private val defaultKeys = Seq(traceTokenKey, traceNameKey) @@ -37,7 +36,7 @@ trait MdcKeysSupport { // Java variant. def withMdc[A](thunk: Supplier[A]): A = withMdc(thunk.get) - private[this] def copyToMdc(traceContext: TraceContext): Iterable[String] = traceContext match { + private[kamon] def copyToMdc(traceContext: TraceContext): Iterable[String] = traceContext match { case ctx: MetricsOnlyContext ⇒ // Add the default key value pairs for the trace token and trace name. @@ -46,7 +45,7 @@ trait MdcKeysSupport { defaultKeys ++ ctx.traceLocalStorage.underlyingStorage.collect { case (available: AvailableToMdc, value) ⇒ Map(available.mdcKey -> String.valueOf(value)) - }.map { value ⇒ value.map { case (k, v) ⇒ MDC.put(k, v); k } }.flatten + }.flatMap { value ⇒ value.map { case (k, v) ⇒ MDC.put(k, v); k } } case EmptyTraceContext ⇒ Iterable.empty[String] } |