public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for (Object o : loggers.values()) { Logger logger = (Logger) o; logger.setThreshold(currentThreshold); } }
/** * Sets the threshold for all new loggers. It will NOT affect the existing loggers. * <p>This is usually only set once while the logger manager is configured.</p> * * @param currentThreshold The new threshold. */ public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for (Object o : loggerCache.values()) { Logger logger = (Logger) o; logger.setThreshold(currentThreshold); } }
/** * {@inheritDoc} */ public void setThreshold(int threshold) { logger.setThreshold(threshold); }
public void setDebugEnabled( boolean enabled ) { if ( enabled ) { logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_DEBUG ); } else { logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_INFO ); } }
public void setDebugEnabled( boolean enabled ) { if ( enabled ) { logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_DEBUG ); } else { logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_INFO ); } }
public void setThresholds( final int currentThreshold ) { logger.setThreshold( currentThreshold ); }
public void setThreshold( final int currentThreshold ) { logger.setThreshold( currentThreshold ); }
/** {@inheritDoc} */ public void setLogLevel( int level ) { if ( level <= LEVEL_DEBUG ) { logger.setThreshold( Logger.LEVEL_DEBUG ); } else if ( level <= LEVEL_INFO ) { logger.setThreshold( Logger.LEVEL_INFO ); } else if ( level <= LEVEL_WARN ) { logger.setThreshold( Logger.LEVEL_WARN ); } else if ( level <= LEVEL_ERROR ) { logger.setThreshold( Logger.LEVEL_ERROR ); } else { logger.setThreshold( Logger.LEVEL_DISABLED ); } }
public final synchronized void setThresholds( final int currentThreshold ) { this.currentThreshold = currentThreshold; for ( final Logger logger : activeLoggers.values() ) { logger.setThreshold( currentThreshold ); } }
public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for ( Iterator logs = loggers.values().iterator(); logs.hasNext(); ) { Logger logger = (Logger) logs.next(); logger.setThreshold( currentThreshold ); } }
public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for ( Iterator logs = loggers.values().iterator(); logs.hasNext(); ) { Logger logger = (Logger) logs.next(); logger.setThreshold( currentThreshold ); } }
public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for ( Iterator logs = loggers.values().iterator(); logs.hasNext(); ) { Logger logger = (Logger) logs.next(); logger.setThreshold( currentThreshold ); } }
/** * Sets the threshold for all new loggers. It will NOT affect the existing loggers. * <p/> * This is usually only set once while the logger manager is configured. * * @param currentThreshold The new threshold. */ public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for ( Iterator logs = loggerCache.values().iterator(); logs.hasNext(); ) { Logger logger = (Logger) logs.next(); logger.setThreshold( currentThreshold ); } }
/** * Sets the threshold for all new loggers. It will NOT affect the existing loggers. * <p/> * This is usually only set once while the logger manager is configured. * * @param currentThreshold The new threshold. */ public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for ( Iterator logs = loggerCache.values().iterator(); logs.hasNext(); ) { Logger logger = (Logger) logs.next(); logger.setThreshold( currentThreshold ); } }
/** * Sets the threshold for all new loggers. It will NOT affect the existing loggers. * <p/> * This is usually only set once while the logger manager is configured. * * @param currentThreshold The new threshold. */ public void setThresholds( int currentThreshold ) { this.currentThreshold = currentThreshold; for ( Iterator logs = loggerCache.values().iterator(); logs.hasNext(); ) { Logger logger = (Logger) logs.next(); logger.setThreshold( currentThreshold ); } }
public void setThreshold( final String threshold ) { logger.setThreshold( BaseLoggerManager.parseThreshold( threshold ) ); }
public final synchronized Logger getLoggerForComponent( final String role, final String hint ) { final String name = Roles.canonicalRoleHint( role, hint ); Logger logger = activeLoggers.get( name ); if ( null == logger ) { logger = createLogger( name ); logger.setThreshold( currentThreshold ); activeLoggers.put( name, logger ); } return logger; }
private void disableLogging() throws MojoExecutionException { // Maven < 3.1 Logger logger; try { logger = (Logger) FieldUtils.readField(getLog(), "logger", true); } catch (IllegalAccessException e) { throw new MojoExecutionException("Unable to access logger field ", e); } logger.setThreshold(5); // Maven >= 3.1 ILoggerFactory slf4jLoggerFactory = LoggerFactory.getILoggerFactory(); Slf4jConfiguration slf4jConfiguration = Slf4jConfigurationFactory.getConfiguration(slf4jLoggerFactory); slf4jConfiguration.setRootLoggerLevel(Slf4jConfiguration.Level.ERROR); slf4jConfiguration.activate(); } }
private void disableLogging() throws MojoExecutionException { // Maven < 3.1 Logger logger; try { logger = (Logger) FieldUtils.readField(getLog(), "logger", true); } catch (IllegalAccessException e) { throw new MojoExecutionException("Unable to access logger field ", e); } logger.setThreshold(5); // Maven >= 3.1 ILoggerFactory slf4jLoggerFactory = LoggerFactory.getILoggerFactory(); Slf4jConfiguration slf4jConfiguration = Slf4jConfigurationFactory.getConfiguration(slf4jLoggerFactory); slf4jConfiguration.setRootLoggerLevel(Slf4jConfiguration.Level.ERROR); slf4jConfiguration.activate(); } }
plexusLogger.setThreshold( cliRequest.request.getLoggingLevel() );