Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui committed Aug 8, 2023
1 parent 9ade8cf commit 54b288d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ch.qos.logback.classic.BasicConfigurator;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.Context;
import java.util.Optional;

/**
Expand All @@ -11,13 +12,15 @@
public class LogbackConfigurator extends BasicConfigurator {

@Override
public ExecutionStatus configure(LoggerContext lc) {
super.configure(lc);
public ExecutionStatus configure(Context context) {
super.configure(context);
Level rootLevel =
Optional.ofNullable(System.getenv("SYNAPSE_JUNIT_EXTENSION_TEST_LOG_ROOT_LEVEL"))
.map(Level::valueOf)
.orElse(Level.OFF);
lc.getLogger("ROOT").setLevel(rootLevel);

LoggerContext loggerContext = (LoggerContext) context;
loggerContext.getLogger("ROOT").setLevel(rootLevel);
return ExecutionStatus.DO_NOT_INVOKE_NEXT_IF_ANY;
}
}

0 comments on commit 54b288d

Please sign in to comment.