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) {
|
public ExecutionStatus configure(LoggerContext lc) {
|
||||||
final var rootLogger = lc.getLogger(Logger.ROOT_LOGGER_NAME);
|
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);
|
rootLogger.setLevel(defaultLevel);
|
||||||
|
|
||||||
final var consoleLayout = verboseLevel == 0 || logFile != null
|
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));
|
final var consoleAppender = createLoggingConsoleAppender(lc, createLayoutWrappingEncoder(consoleLayout));
|
||||||
rootLogger.addAppender(consoleAppender);
|
rootLogger.addAppender(consoleAppender);
|
||||||
|
|
||||||
lc.getLogger("com.zaxxer.hikari")
|
lc.getLogger("org.asamk").setLevel(verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.DEBUG : Level.INFO);
|
||||||
.setLevel(verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.INFO : Level.WARN);
|
|
||||||
|
|
||||||
if (logFile != null) {
|
if (logFile != null) {
|
||||||
consoleAppender.addFilter(new Filter<>() {
|
consoleAppender.addFilter(new Filter<>() {
|
||||||
@Override
|
@Override
|
||||||
public FilterReply decide(final ILoggingEvent event) {
|
public FilterReply decide(final ILoggingEvent event) {
|
||||||
return event.getLevel().isGreaterOrEqual(Level.INFO)
|
return event.getLevel().isGreaterOrEqual(Level.WARN) || (
|
||||||
&& !"LibSignal".equals(event.getLoggerName())
|
event.getLevel().isGreaterOrEqual(Level.INFO) && event.getLoggerName()
|
||||||
&& (
|
.startsWith("org.asamk")
|
||||||
event.getLevel().isGreaterOrEqual(Level.WARN) || !event.getLoggerName()
|
|
||||||
.startsWith("com.zaxxer.hikari")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
? FilterReply.NEUTRAL : FilterReply.DENY;
|
? FilterReply.NEUTRAL : FilterReply.DENY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue