Skip to content

Commit

Permalink
feat: set tracelogger functions to protected
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeQuadrat committed Jul 17, 2024
1 parent bf6cc5e commit 789042b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sbt._
//settings

name := """scala-utils"""
val releaseVersion = "2.0.10"
val releaseVersion = "2.0.11"

val token = sys.env.getOrElse("GITHUB_TOKEN", "")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait TraceContext extends ImplicitLogContext with ContextWithHeaders {
def httpHeaders: HttpHeaders
def span: Option[Span]

private val traceLogger = new TraceLogger(span)
protected val traceLogger = new TraceLogger(span)
final def log: TraceLogger = traceLogger

def logIfDebug(message: String, entity: Option[String] = None): Unit =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import play.api.libs.json.Json
class TraceLogger(span: Option[Span]) {
private val logger: org.slf4j.Logger = Logger.apply("request-context").logger

private def getMarker(span: Span, entity: Option[String])(implicit logContext: LogContext): Marker =
protected def getMarker(span: Span, entity: Option[String])(implicit logContext: LogContext): Marker =
MarkerFactory.getMarker(spanToMarker(span, entity))

private def spanToMarker(span: Span, entity: Option[String])(implicit logContext: LogContext): String =
protected def spanToMarker(span: Span, entity: Option[String])(implicit logContext: LogContext): String =
Json.prettyPrint(Json.toJson(logContext.toLogbackContext(span.getSpanContext.getTraceId, entity)))

def warn(message: String, entity: Option[String] = None)(implicit logContext: LogContext): Unit =
Expand Down

0 comments on commit 789042b

Please sign in to comment.