Skip to content

Commit

Permalink
Updates and removes log4j specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Dufranne committed Sep 18, 2018
1 parent ab935f6 commit 4d07962
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 105 deletions.
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ lazy val cuttle =
libraryDependencies ++= Seq(
"mysql" % "mysql-connector-java" % "6.0.6"
),
libraryDependencies ++= Seq(
"log4j" % "log4j" % "1.2.17" % "provided"
),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1",
"org.mockito" % "mockito-all" % "1.10.19",
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/com/criteo/cuttle/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ class Executor[S <: Scheduling] private[cuttle] (val platforms: Seq[ExecutionPla

// wrap the execution context so that we can register the name of the thread of each
// runnable (and thus future) that will be run by the side effect.
val sideEffectExecutionContext = SideEffectExecutionContext.wrap(runnable => new Runnable {
val sideEffectExecutionContext = SideEffectThreadPool.wrap(runnable => new Runnable {
override def run(): Unit = {
val tName = Thread.currentThread().getName
Executor.threadNamesToStreams.put(tName, streams)
Expand All @@ -882,7 +882,7 @@ class Executor[S <: Scheduling] private[cuttle] (val platforms: Seq[ExecutionPla
Executor.threadNamesToStreams.remove(tName)
}
}
})(Implicits.sideEffectExecutionContext)
})(Implicits.sideEffectThreadPool)

val execution = Execution(
id = nextExecutionId,
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/scala/com/criteo/cuttle/ThreadPools.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ object ThreadPools {
// dedicated threadpool to start new executions and run user-defined side effects
sealed trait SideEffectThreadPool extends WrappedThreadPool with Metrics

object SideEffectExecutionContext {
def wrap(wrapRunnable: Runnable => Runnable)(implicit executionContext: SideEffectExecutionContext): SideEffectExecutionContext = {
new SideEffectExecutionContext {
object SideEffectThreadPool {
def wrap(wrapRunnable: Runnable => Runnable)(implicit executionContext: SideEffectThreadPool): SideEffectThreadPool = {
new SideEffectThreadPool {
private val delegate = executionContext.underlying

override val underlying: ExecutionContext = new ExecutionContext {
Expand Down

This file was deleted.

This file was deleted.

1 comment on commit 4d07962

@BenoitHanotte
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Arnaud, I am not sure I understand why the ExecutionStreamAppender file was removed. This is the Log4J appender that intercepts the slf4j/log4j logs and redirects them to the execution streams. Without this code I am not sure we can actually redirect the logs, or maybe I am missing something?

Please sign in to comment.