Skip to content

Instantly share code, notes, and snippets.

@vhutov
Created February 12, 2020 21:20
Show Gist options
  • Save vhutov/bb7e5dc54de8b6473d2033f586c39d3e to your computer and use it in GitHub Desktop.
Save vhutov/bb7e5dc54de8b6473d2033f586c39d3e to your computer and use it in GitHub Desktop.
class LoggingExecutionContext(ec: ExecutionContext) extends ExecutionContext {
override def execute(runnable: Runnable): Unit = {
val context = LoggingContext.localContext.value
ec.execute(new WrappedRunnable(runnable, context))
}
override def reportFailure(cause: Throwable): Unit = ec.reportFailure(cause)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment