org.codehaus.plexus.logging.Logger.setThreshold()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(231)

本文整理了Java中org.codehaus.plexus.logging.Logger.setThreshold()方法的一些代码示例,展示了Logger.setThreshold()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.setThreshold()方法的具体详情如下:
包路径:org.codehaus.plexus.logging.Logger
类名称:Logger
方法名:setThreshold

Logger.setThreshold介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.plexus/plexus-container-default

  1. public void setThresholds( int currentThreshold )
  2. {
  3. this.currentThreshold = currentThreshold;
  4. for (Object o : loggers.values()) {
  5. Logger logger = (Logger) o;
  6. logger.setThreshold(currentThreshold);
  7. }
  8. }

代码示例来源:origin: org.codehaus.plexus/plexus-container-default

  1. /**
  2. * Sets the threshold for all new loggers. It will NOT affect the existing loggers.
  3. * <p>This is usually only set once while the logger manager is configured.</p>
  4. *
  5. * @param currentThreshold The new threshold.
  6. */
  7. public void setThresholds( int currentThreshold )
  8. {
  9. this.currentThreshold = currentThreshold;
  10. for (Object o : loggerCache.values()) {
  11. Logger logger = (Logger) o;
  12. logger.setThreshold(currentThreshold);
  13. }
  14. }

代码示例来源:origin: com.marvelution.maven.components/maven-executor

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public void setThreshold(int threshold) {
  5. logger.setThreshold(threshold);
  6. }

代码示例来源:origin: org.sonatype.plexus/plexus-jetty6

  1. public void setDebugEnabled( boolean enabled )
  2. {
  3. if ( enabled )
  4. {
  5. logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_DEBUG );
  6. }
  7. else
  8. {
  9. logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_INFO );
  10. }
  11. }

代码示例来源:origin: org.sonatype.plexus/plexus-jetty6

  1. public void setDebugEnabled( boolean enabled )
  2. {
  3. if ( enabled )
  4. {
  5. logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_DEBUG );
  6. }
  7. else
  8. {
  9. logger.setThreshold( org.codehaus.plexus.logging.Logger.LEVEL_INFO );
  10. }
  11. }

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

  1. public void setThresholds( final int currentThreshold )
  2. {
  3. logger.setThreshold( currentThreshold );
  4. }

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

  1. public void setThreshold( final int currentThreshold )
  2. {
  3. logger.setThreshold( currentThreshold );
  4. }

代码示例来源:origin: org.apache.maven.doxia/doxia-logging-api

  1. /** {@inheritDoc} */
  2. public void setLogLevel( int level )
  3. {
  4. if ( level <= LEVEL_DEBUG )
  5. {
  6. logger.setThreshold( Logger.LEVEL_DEBUG );
  7. }
  8. else if ( level <= LEVEL_INFO )
  9. {
  10. logger.setThreshold( Logger.LEVEL_INFO );
  11. }
  12. else if ( level <= LEVEL_WARN )
  13. {
  14. logger.setThreshold( Logger.LEVEL_WARN );
  15. }
  16. else if ( level <= LEVEL_ERROR )
  17. {
  18. logger.setThreshold( Logger.LEVEL_ERROR );
  19. }
  20. else
  21. {
  22. logger.setThreshold( Logger.LEVEL_DISABLED );
  23. }
  24. }

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

  1. public final synchronized void setThresholds( final int currentThreshold )
  2. {
  3. this.currentThreshold = currentThreshold;
  4. for ( final Logger logger : activeLoggers.values() )
  5. {
  6. logger.setThreshold( currentThreshold );
  7. }
  8. }

代码示例来源:origin: org.codehaus.plexus/plexus-spring

  1. public void setThresholds( int currentThreshold )
  2. {
  3. this.currentThreshold = currentThreshold;
  4. for ( Iterator logs = loggers.values().iterator(); logs.hasNext(); )
  5. {
  6. Logger logger = (Logger) logs.next();
  7. logger.setThreshold( currentThreshold );
  8. }
  9. }

代码示例来源:origin: org.codehaus.redback/plexus-spring

  1. public void setThresholds( int currentThreshold )
  2. {
  3. this.currentThreshold = currentThreshold;
  4. for ( Iterator logs = loggers.values().iterator(); logs.hasNext(); )
  5. {
  6. Logger logger = (Logger) logs.next();
  7. logger.setThreshold( currentThreshold );
  8. }
  9. }

代码示例来源:origin: org.codehaus.plexus/com.springsource.org.codehaus.plexus.container

  1. public void setThresholds( int currentThreshold )
  2. {
  3. this.currentThreshold = currentThreshold;
  4. for ( Iterator logs = loggers.values().iterator(); logs.hasNext(); )
  5. {
  6. Logger logger = (Logger) logs.next();
  7. logger.setThreshold( currentThreshold );
  8. }
  9. }

代码示例来源:origin: org.codehaus.redback/plexus-spring

  1. /**
  2. * Sets the threshold for all new loggers. It will NOT affect the existing loggers.
  3. * <p/>
  4. * This is usually only set once while the logger manager is configured.
  5. *
  6. * @param currentThreshold The new threshold.
  7. */
  8. public void setThresholds( int currentThreshold )
  9. {
  10. this.currentThreshold = currentThreshold;
  11. for ( Iterator logs = loggerCache.values().iterator(); logs.hasNext(); )
  12. {
  13. Logger logger = (Logger) logs.next();
  14. logger.setThreshold( currentThreshold );
  15. }
  16. }

代码示例来源:origin: org.codehaus.plexus/com.springsource.org.codehaus.plexus.container

  1. /**
  2. * Sets the threshold for all new loggers. It will NOT affect the existing loggers.
  3. * <p/>
  4. * This is usually only set once while the logger manager is configured.
  5. *
  6. * @param currentThreshold The new threshold.
  7. */
  8. public void setThresholds( int currentThreshold )
  9. {
  10. this.currentThreshold = currentThreshold;
  11. for ( Iterator logs = loggerCache.values().iterator(); logs.hasNext(); )
  12. {
  13. Logger logger = (Logger) logs.next();
  14. logger.setThreshold( currentThreshold );
  15. }
  16. }

代码示例来源:origin: org.codehaus.plexus/plexus-spring

  1. /**
  2. * Sets the threshold for all new loggers. It will NOT affect the existing loggers.
  3. * <p/>
  4. * This is usually only set once while the logger manager is configured.
  5. *
  6. * @param currentThreshold The new threshold.
  7. */
  8. public void setThresholds( int currentThreshold )
  9. {
  10. this.currentThreshold = currentThreshold;
  11. for ( Iterator logs = loggerCache.values().iterator(); logs.hasNext(); )
  12. {
  13. Logger logger = (Logger) logs.next();
  14. logger.setThreshold( currentThreshold );
  15. }
  16. }

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

  1. public void setThreshold( final String threshold )
  2. {
  3. logger.setThreshold( BaseLoggerManager.parseThreshold( threshold ) );
  4. }

代码示例来源:origin: org.eclipse.sisu/org.eclipse.sisu.plexus

  1. public final synchronized Logger getLoggerForComponent( final String role, final String hint )
  2. {
  3. final String name = Roles.canonicalRoleHint( role, hint );
  4. Logger logger = activeLoggers.get( name );
  5. if ( null == logger )
  6. {
  7. logger = createLogger( name );
  8. logger.setThreshold( currentThreshold );
  9. activeLoggers.put( name, logger );
  10. }
  11. return logger;
  12. }

代码示例来源:origin: org.twdata.maven/mojo-executor-maven-plugin

  1. private void disableLogging() throws MojoExecutionException {
  2. // Maven < 3.1
  3. Logger logger;
  4. try {
  5. logger = (Logger) FieldUtils.readField(getLog(), "logger", true);
  6. } catch (IllegalAccessException e) {
  7. throw new MojoExecutionException("Unable to access logger field ", e);
  8. }
  9. logger.setThreshold(5);
  10. // Maven >= 3.1
  11. ILoggerFactory slf4jLoggerFactory = LoggerFactory.getILoggerFactory();
  12. Slf4jConfiguration slf4jConfiguration = Slf4jConfigurationFactory.getConfiguration(slf4jLoggerFactory);
  13. slf4jConfiguration.setRootLoggerLevel(Slf4jConfiguration.Level.ERROR);
  14. slf4jConfiguration.activate();
  15. }
  16. }

代码示例来源:origin: TimMoore/mojo-executor

  1. private void disableLogging() throws MojoExecutionException {
  2. // Maven < 3.1
  3. Logger logger;
  4. try {
  5. logger = (Logger) FieldUtils.readField(getLog(), "logger", true);
  6. } catch (IllegalAccessException e) {
  7. throw new MojoExecutionException("Unable to access logger field ", e);
  8. }
  9. logger.setThreshold(5);
  10. // Maven >= 3.1
  11. ILoggerFactory slf4jLoggerFactory = LoggerFactory.getILoggerFactory();
  12. Slf4jConfiguration slf4jConfiguration = Slf4jConfigurationFactory.getConfiguration(slf4jLoggerFactory);
  13. slf4jConfiguration.setRootLoggerLevel(Slf4jConfiguration.Level.ERROR);
  14. slf4jConfiguration.activate();
  15. }
  16. }

代码示例来源:origin: org.jvnet.hudson.main/maven3-interceptor

  1. plexusLogger.setThreshold( cliRequest.request.getLoggingLevel() );

相关文章