mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
parent
8a0005d900
commit
8c1b5d54f7
1 changed files with 5 additions and 8 deletions
|
@ -37,7 +37,7 @@ public class LogConfigurator extends ContextAwareBase implements Configurator {
|
|||
public ExecutionStatus configure(LoggerContext lc) {
|
||||
final var rootLogger = lc.getLogger(Logger.ROOT_LOGGER_NAME);
|
||||
|
||||
final var defaultLevel = verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.DEBUG : Level.INFO;
|
||||
final var defaultLevel = verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.INFO : Level.WARN;
|
||||
rootLogger.setLevel(defaultLevel);
|
||||
|
||||
final var consoleLayout = verboseLevel == 0 || logFile != null
|
||||
|
@ -46,18 +46,15 @@ public class LogConfigurator extends ContextAwareBase implements Configurator {
|
|||
final var consoleAppender = createLoggingConsoleAppender(lc, createLayoutWrappingEncoder(consoleLayout));
|
||||
rootLogger.addAppender(consoleAppender);
|
||||
|
||||
lc.getLogger("com.zaxxer.hikari")
|
||||
.setLevel(verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.INFO : Level.WARN);
|
||||
lc.getLogger("org.asamk").setLevel(verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.DEBUG : Level.INFO);
|
||||
|
||||
if (logFile != null) {
|
||||
consoleAppender.addFilter(new Filter<>() {
|
||||
@Override
|
||||
public FilterReply decide(final ILoggingEvent event) {
|
||||
return event.getLevel().isGreaterOrEqual(Level.INFO)
|
||||
&& !"LibSignal".equals(event.getLoggerName())
|
||||
&& (
|
||||
event.getLevel().isGreaterOrEqual(Level.WARN) || !event.getLoggerName()
|
||||
.startsWith("com.zaxxer.hikari")
|
||||
return event.getLevel().isGreaterOrEqual(Level.WARN) || (
|
||||
event.getLevel().isGreaterOrEqual(Level.INFO) && event.getLoggerName()
|
||||
.startsWith("org.asamk")
|
||||
)
|
||||
|
||||
? FilterReply.NEUTRAL : FilterReply.DENY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue