diff options
author | Jakob Odersky <jakob@driver.xyz> | 2018-09-11 13:35:03 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@driver.xyz> | 2018-09-12 14:17:39 -0700 |
commit | 8a21ee2028b5f11fe0b9148078b49e4000937202 (patch) | |
tree | 3a17b99676e729988ca41ba61199b33d2afbbcbe /src/main/scala/xyz/driver/core/reporting/GoogleMdcLogger.scala | |
parent | 8b2cd70a7189775cb23dafbbd3670b8050dd28dc (diff) | |
download | driver-core-8a21ee2028b5f11fe0b9148078b49e4000937202.tar.gz driver-core-8a21ee2028b5f11fe0b9148078b49e4000937202.tar.bz2 driver-core-8a21ee2028b5f11fe0b9148078b49e4000937202.zip |
Rearchitect reporting stack to mixin-based structure
Diffstat (limited to 'src/main/scala/xyz/driver/core/reporting/GoogleMdcLogger.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/reporting/GoogleMdcLogger.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/reporting/GoogleMdcLogger.scala b/src/main/scala/xyz/driver/core/reporting/GoogleMdcLogger.scala new file mode 100644 index 0000000..f5c41cf --- /dev/null +++ b/src/main/scala/xyz/driver/core/reporting/GoogleMdcLogger.scala @@ -0,0 +1,14 @@ +package xyz.driver.core +package reporting + +import org.slf4j.MDC + +trait GoogleMdcLogger extends Reporter { self: GoogleReporter => + + abstract override def log(severity: Reporter.Severity, message: String, reason: Option[Throwable])( + implicit ctx: SpanContext): Unit = { + MDC.put("trace", s"projects/${credentials.getProjectId}/traces/${ctx.traceId}") + super.log(severity, message, reason) + } + +} |