Skip to content

Commit

Permalink
Log Cats Effect 2 instrumentation with Finest log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Szarek committed Mar 3, 2023
1 parent a8c79f7 commit 1d37716
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import java.util.logging.Level
import scala.concurrent.ExecutionContext

class TokenAwareExecutionContext(delegate: ExecutionContext) extends ExecutionContext {
AgentBridge.getAgent.getLogger.log(Level.INFO, s"[${Thread.currentThread().getName}] Instrumenting IOShift " +
s"ExecutionContext $delegate")
if (AgentBridge.getAgent.getLogger.isLoggable(Level.FINEST)) {
AgentBridge.getAgent.getLogger.log(Level.FINEST, s"[${Thread.currentThread().getName}] Instrumenting IOShift " +
s"ExecutionContext $delegate")
}
override def execute(runnable: Runnable): Unit = {
delegate.execute(new TokenAwareRunnable(runnable))
}
Expand Down

0 comments on commit 1d37716

Please sign in to comment.