@Test public void testEnabledX_Warn() throws Exception { root.setLevel(Level.WARN); checkLevelThreshold(loggerTest, Level.WARN); }
public synchronized void setLevel(Level newLevel) { if (level == newLevel) { return; } if (newLevel == null && isRootLogger()) { throw new IllegalArgumentException("The level of the root logger cannot be set to null"); } level = newLevel; if (newLevel == null) { effectiveLevelInt = parent.effectiveLevelInt; newLevel = parent.getEffectiveLevel(); } else { effectiveLevelInt = newLevel.levelInt; } if (childrenList != null) { int len = childrenList.size(); for (int i = 0; i < len; i++) { Logger child = (Logger) childrenList.get(i); child.handleParentLevelChange(effectiveLevelInt); } } loggerContext.fireOnLevelChange(this, newLevel); }
Logger implements org.slf4j.Logger, LocationAwareLogger, AppenderAttachable<ILoggingEvent>, Serializable { public synchronized void setLevel(Level newLevel) { if (level == newLevel) { return; } if (newLevel == null && isRootLogger()) { throw new IllegalArgumentException("The level of the root logger cannot be set to null"); } level = newLevel; if (newLevel == null) { effectiveLevelInt = parent.effectiveLevelInt; newLevel = parent.getEffectiveLevel(); } else { effectiveLevelInt = newLevel.levelInt; } if (childrenList != null) { int len = childrenList.size(); for (int i = 0; i < len; i++) { Logger child = (Logger) childrenList.get(i); child.handleParentLevelChange(effectiveLevelInt); } } loggerContext.fireOnLevelChange(this, newLevel); } }
Logger implements org.slf4j.Logger, LocationAwareLogger, AppenderAttachable<ILoggingEvent>, Serializable { public synchronized void setLevel(Level newLevel) { if (level == newLevel) { return; } if (newLevel == null && isRootLogger()) { throw new IllegalArgumentException("The level of the root logger cannot be set to null"); } level = newLevel; if (newLevel == null) { effectiveLevelInt = parent.effectiveLevelInt; newLevel = parent.getEffectiveLevel(); } else { effectiveLevelInt = newLevel.levelInt; } if (childrenList != null) { int len = childrenList.size(); for (int i = 0; i < len; i++) { Logger child = (Logger) childrenList.get(i); child.handleParentLevelChange(effectiveLevelInt); } } loggerContext.fireOnLevelChange(this, newLevel); } Logger(String name, Logger parent, LoggerContext loggerContext); }
Logger implements org.slf4j.Logger, LocationAwareLogger, AppenderAttachable<ILoggingEvent>, Serializable { public synchronized void setLevel(Level newLevel) { if (level == newLevel) { return; } if (newLevel == null && isRootLogger()) { throw new IllegalArgumentException("The level of the root logger cannot be set to null"); } level = newLevel; if (newLevel == null) { effectiveLevelInt = parent.effectiveLevelInt; newLevel = parent.getEffectiveLevel(); } else { effectiveLevelInt = newLevel.levelInt; } if (childrenList != null) { int len = childrenList.size(); for (int i = 0; i < len; i++) { Logger child = (Logger) childrenList.get(i); child.handleParentLevelChange(effectiveLevelInt); } } loggerContext.fireOnLevelChange(this, newLevel); } Logger(String name, Logger parent, LoggerContext loggerContext); Level getEffectiveLevel(); Level getLevel(); String getName(); synchronized void setLevel(Level newLevel); void detachAndStopAllAppenders(); boolean detachAppender(String name); synchronized void addAppender(Appender<ILoggingEvent> newAppender); boolean isAttached(Appender<ILoggingEvent> appender); @SuppressWarnings("unchecked") Iterator<Appender<ILoggingEvent>> iteratorForAppenders(); Appender<ILoggingEvent> getAppender(String name); void callAppenders(ILoggingEvent event); boolean detachAppender(Appender<ILoggingEvent> appender); void trace(String msg); void trace(String format, Object arg); void trace(String format, Object arg1, Object arg2); void trace(String format, Object... argArray); void trace(String msg, Throwable t); void trace(Marker marker, String msg); void trace(Marker marker, String format, Object arg); void trace(Marker marker, String format, Object arg1, Object arg2); void trace(Marker marker, String format, Object... argArray); void trace(Marker marker, String msg, Throwable t); boolean isDebugEnabled(); boolean isDebugEnabled(Marker marker); void debug(String msg); void debug(String format, Object arg); void debug(String format, Object arg1, Object arg2); void debug(String format, Object... argArray); void debug(String msg, Throwable t); void debug(Marker marker, String msg); void debug(Marker marker, String format, Object arg); void debug(Marker marker, String format, Object arg1, Object arg2); void debug(Marker marker, String format, Object... argArray); void debug(Marker marker, String msg, Throwable t); void error(String msg); void error(String format, Object arg); void error(String format, Object arg1, Object arg2); void error(String format, Object... argArray); void error(String msg, Throwable t); void error(Marker marker, String msg); void error(Marker marker, String format, Object arg); void error(Marker marker, String format, Object arg1, Object arg2); void error(Marker marker, String format, Object... argArray); void error(Marker marker, String msg, Throwable t); boolean isInfoEnabled(); boolean isInfoEnabled(Marker marker); void info(String msg); void info(String format, Object arg); void info(String format, Object arg1, Object arg2); void info(String format, Object... argArray); void info(String msg, Throwable t); void info(Marker marker, String msg); void info(Marker marker, String format, Object arg); void info(Marker marker, String format, Object arg1, Object arg2); void info(Marker marker, String format, Object... argArray); void info(Marker marker, String msg, Throwable t); boolean isTraceEnabled(); boolean isTraceEnabled(Marker marker); boolean isErrorEnabled(); boolean isErrorEnabled(Marker marker); boolean isWarnEnabled(); boolean isWarnEnabled(Marker marker); boolean isEnabledFor(Marker marker, Level level); boolean isEnabledFor(Level level); void warn(String msg); void warn(String msg, Throwable t); void warn(String format, Object arg); void warn(String format, Object arg1, Object arg2); void warn(String format, Object... argArray); void warn(Marker marker, String msg); void warn(Marker marker, String format, Object arg); void warn(Marker marker, String format, Object... argArray); void warn(Marker marker, String format, Object arg1, Object arg2); void warn(Marker marker, String msg, Throwable t); boolean isAdditive(); void setAdditive(boolean additive); String toString(); LoggerContext getLoggerContext(); @Override LoggingEventBuilder makeLoggingEventBuilder(org.slf4j.event.Level level); void log(Marker marker, String fqcn, int levelInt, String message, Object[] argArray, Throwable t); void log(org.slf4j.event.LoggingEvent slf4jEvent); }
Logger implements org.slf4j.Logger, LocationAwareLogger, AppenderAttachable<ILoggingEvent>, Serializable { public synchronized void setLevel(Level newLevel) { if (level == newLevel) { return; } if (newLevel == null && isRootLogger()) { throw new IllegalArgumentException("The level of the root logger cannot be set to null"); } level = newLevel; if (newLevel == null) { effectiveLevelInt = parent.effectiveLevelInt; newLevel = parent.getEffectiveLevel(); } else { effectiveLevelInt = newLevel.levelInt; } if (childrenList != null) { int len = childrenList.size(); for (int i = 0; i < len; i++) { Logger child = (Logger) childrenList.get(i); child.handleParentLevelChange(effectiveLevelInt); } } loggerContext.fireOnLevelChange(this, newLevel); } Logger(String name, Logger parent, LoggerContext loggerContext); Level getEffectiveLevel(); Level getLevel(); String getName(); synchronized void setLevel(Level newLevel); void detachAndStopAllAppenders(); boolean detachAppender(String name); synchronized void addAppender(Appender<ILoggingEvent> newAppender); boolean isAttached(Appender<ILoggingEvent> appender); @SuppressWarnings("unchecked") Iterator<Appender<ILoggingEvent>> iteratorForAppenders(); Appender<ILoggingEvent> getAppender(String name); void callAppenders(ILoggingEvent event); boolean detachAppender(Appender<ILoggingEvent> appender); void trace(String msg); void trace(String format, Object arg); void trace(String format, Object arg1, Object arg2); void trace(String format, Object... argArray); void trace(String msg, Throwable t); void trace(Marker marker, String msg); void trace(Marker marker, String format, Object arg); void trace(Marker marker, String format, Object arg1, Object arg2); void trace(Marker marker, String format, Object... argArray); void trace(Marker marker, String msg, Throwable t); boolean isDebugEnabled(); boolean isDebugEnabled(Marker marker); void debug(String msg); void debug(String format, Object arg); void debug(String format, Object arg1, Object arg2); void debug(String format, Object... argArray); void debug(String msg, Throwable t); void debug(Marker marker, String msg); void debug(Marker marker, String format, Object arg); void debug(Marker marker, String format, Object arg1, Object arg2); void debug(Marker marker, String format, Object... argArray); void debug(Marker marker, String msg, Throwable t); void error(String msg); void error(String format, Object arg); void error(String format, Object arg1, Object arg2); void error(String format, Object... argArray); void error(String msg, Throwable t); void error(Marker marker, String msg); void error(Marker marker, String format, Object arg); void error(Marker marker, String format, Object arg1, Object arg2); void error(Marker marker, String format, Object... argArray); void error(Marker marker, String msg, Throwable t); boolean isInfoEnabled(); boolean isInfoEnabled(Marker marker); void info(String msg); void info(String format, Object arg); void info(String format, Object arg1, Object arg2); void info(String format, Object... argArray); void info(String msg, Throwable t); void info(Marker marker, String msg); void info(Marker marker, String format, Object arg); void info(Marker marker, String format, Object arg1, Object arg2); void info(Marker marker, String format, Object... argArray); void info(Marker marker, String msg, Throwable t); boolean isTraceEnabled(); boolean isTraceEnabled(Marker marker); boolean isErrorEnabled(); boolean isErrorEnabled(Marker marker); boolean isWarnEnabled(); boolean isWarnEnabled(Marker marker); boolean isEnabledFor(Marker marker, Level level); boolean isEnabledFor(Level level); void warn(String msg); void warn(String msg, Throwable t); void warn(String format, Object arg); void warn(String format, Object arg1, Object arg2); void warn(String format, Object... argArray); void warn(Marker marker, String msg); void warn(Marker marker, String format, Object arg); void warn(Marker marker, String format, Object... argArray); void warn(Marker marker, String format, Object arg1, Object arg2); void warn(Marker marker, String msg, Throwable t); boolean isAdditive(); void setAdditive(boolean additive); String toString(); LoggerContext getLoggerContext(); @Override LoggingEventBuilder makeLoggingEventBuilder(org.slf4j.event.Level level); void log(Marker marker, String fqcn, int levelInt, String message, Object[] argArray, Throwable t); void log(org.slf4j.event.LoggingEvent slf4jEvent); static final String FQCN; }