From c63347581e61c624d9fdcea5a6fd471024249b97 Mon Sep 17 00:00:00 2001 From: Geoffroy Jamgotchian Date: Wed, 11 Oct 2023 23:04:01 +0200 Subject: [PATCH] Remove useless logs Signed-off-by: Geoffroy Jamgotchian --- .../java/com/powsybl/python/logging/LoggingCFunctions.java | 6 +++--- java/src/main/resources/logback.xml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/java/src/main/java/com/powsybl/python/logging/LoggingCFunctions.java b/java/src/main/java/com/powsybl/python/logging/LoggingCFunctions.java index 99e11894ac..bdcc9482cc 100644 --- a/java/src/main/java/com/powsybl/python/logging/LoggingCFunctions.java +++ b/java/src/main/java/com/powsybl/python/logging/LoggingCFunctions.java @@ -32,7 +32,7 @@ public final class LoggingCFunctions { private LoggingCFunctions() { } - interface LoggerCallback extends CFunctionPointer { + public interface LoggerCallback extends CFunctionPointer { @InvokeCFunctionPointer void invoke(int level, long timestamp, CCharPointer loggerName, CCharPointer message); } @@ -47,8 +47,8 @@ public static void setupLoggerCallback(IsolateThread thread, LoggerCallback fpoi @CEntryPoint(name = "setLogLevel") public static void setLogLevel(IsolateThread thread, int logLevel, PyPowsyblApiHeader.ExceptionHandlerPointer exceptionHandlerPtr) { doCatch(exceptionHandlerPtr, () -> { - Logger rootLogger = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); - rootLogger.setLevel(PyLoggingUtil.pythonLevelToLogbackLevel(logLevel)); + Logger powsyblLogger = (Logger) LoggerFactory.getLogger("com.powsybl"); + powsyblLogger.setLevel(PyLoggingUtil.pythonLevelToLogbackLevel(logLevel)); }); } } diff --git a/java/src/main/resources/logback.xml b/java/src/main/resources/logback.xml index 9ec939d7ce..b24578aafe 100755 --- a/java/src/main/resources/logback.xml +++ b/java/src/main/resources/logback.xml @@ -11,4 +11,7 @@ + + +