当前位置: 首页>>代码示例>>Java>>正文


Java NOPLogger类代码示例

本文整理汇总了Java中org.slf4j.helpers.NOPLogger的典型用法代码示例。如果您正苦于以下问题:Java NOPLogger类的具体用法?Java NOPLogger怎么用?Java NOPLogger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NOPLogger类属于org.slf4j.helpers包,在下文中一共展示了NOPLogger类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLogger

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * <p>Attempts to find the <strong>real</strong> {@code Logger} instance that
 * is doing the heavy lifting and routes the request to an instance of
 * {@link CasDelegatingLogger}. The instance is cached by the logger name.</p>
 */
@Override
public Logger getLogger(final String name) {
    if (StringUtils.isBlank(name)) {
        return NOPLogger.NOP_LOGGER;
    }
    synchronized (loggerMap) {
        if (!loggerMap.containsKey(name)) {
            final Logger logger = getRealLoggerInstance(name);
            loggerMap.put(name, new CasDelegatingLogger(logger));
        }
        return loggerMap.get(name);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:20,代码来源:CasLoggerFactory.java

示例2: getLogger

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * <p>Attempts to find the <strong>real</strong> <code>Logger</code> instance that
 * is doing the heavy lifting and routes the request to an instance of
 * {@link CasDelegatingLogger}. The instance is cached by the logger name.</p>
 */
@Override
public Logger getLogger(final String name) {
    if (StringUtils.isBlank(name)) {
        return NOPLogger.NOP_LOGGER;
    }
    synchronized (loggerMap) {
        if (!loggerMap.containsKey(name)) {
            final Logger logger = getRealLoggerInstance(name);
            loggerMap.put(name, new CasDelegatingLogger(logger));
        }
        return loggerMap.get(name);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:20,代码来源:CasLoggerFactory.java

示例3: LoggingSlf4jImpl

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
public LoggingSlf4jImpl(Class<?> clazz) {
	final PrintStream filterOut = new PrintStream(System.err) {
		public void println(String logger) {
			if (!logger.startsWith("SLF4J"))
				super.println(logger);
		}
	};
	System.setErr(filterOut);
	logger = LoggerFactory.getLogger(clazz);
	System.setErr(System.err);
	if (logger == null) {
		logger = NOPLogger.NOP_LOGGER;
	}
}
 
开发者ID:axibase,项目名称:atsd-jdbc,代码行数:15,代码来源:LoggingSlf4jImpl.java

示例4: processLog

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
protected LogProcessResult processLog(LogSource source, Account account, String jvmId, boolean sync, GCAnalyse analyze) throws IOException {
    LogProcessResult x = checkAnalyzeCorrect(analyze.id(), jvmId, account.id(), analyze);
    if (x != null) return x;

    Logger log;
    File logFile = null;
    if (analyze.isContinuous()) {
        log = NOPLogger.NOP_LOGGER;
    } else {
        logFile = java.nio.file.Files.createTempFile("gcplot_log", ".log").toFile();
        log = createLogger(logFile);
    }

    Pair<ParseResult, ParsingState> p = parseAndPersist(source, jvmId, analyze, log);
    ParseResult pr = p.getLeft();
    ParsingState ps = p.getRight();

    if (pr.isSuccessful()) {
        updateAnalyzeInfo(analyze.id(), jvmId, account.id(), pr, ps);
        if (pr.getAgesStates().size() > 0) {
            persistObjectAges(analyze.id(), jvmId, pr);
        }
    } else {
        LOG.debug(pr.getException().get().getMessage(), pr.getException().get());
        log.error(pr.getException().get().getMessage(), pr.getException().get());
        return new LogProcessResult(ErrorMessages.buildJson(ErrorMessages.INTERNAL_ERROR));
    }

    if (logFile != null) {
        truncateFile(logFile, getConfig().readLong(ConfigProperty.PARSE_LOG_MAX_FILE_SIZE));
        uploadLogFile(sync, analyze.id(), jvmId, account.username(), logFile);
    }

    return LogProcessResult.SUCCESS;
}
 
开发者ID:dmart28,项目名称:gcplot,代码行数:36,代码来源:DefaultLogsProcessorService.java

示例5: log

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
@Override
public void log(Class<?> logSource, String msg, Object...args){
	Logger logger = this.logger;
	if(logger==null || NOPLogger.class.isInstance(logger)){
		logger = JFishLoggerFactory.getLogger(logSource);
	}
	logger.info(msg, args);
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:9,代码来源:Slf4jTimeLogger.java

示例6: getTimeLogger

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
protected TimeLogger getTimeLogger(){
	TimeLogger logger = this.timeLogger;
	if(logger==null){
		Slf4jTimeLogger slf4j = new Slf4jTimeLogger();
		if(slf4j.getLogger() instanceof NOPLogger){
			logger = new TimerOutputer();
		}else{
			logger = slf4j;
		}
		this.timeLogger = logger;
	}
	return logger;
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:14,代码来源:TimeCounter.java

示例7: getNumThreadsFromCommand

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
private Optional<Integer> getNumThreadsFromCommand(SingularityExecutorTaskProcessCallable taskProcess, Optional<Integer> dockerPid, String commandFormat) throws InterruptedException, ProcessFailedException {
  SimpleProcessManager checkThreadsProcessManager = new SimpleProcessManager(NOPLogger.NOP_LOGGER);
  List<String> cmd = ImmutableList.of("/bin/sh", "-c", String.format(commandFormat, dockerPid.or(taskProcess.getCurrentPid().get())));
  List<String> output = checkThreadsProcessManager.runCommandWithOutput(cmd);
  if (output.isEmpty()) {
    LOG.warn("Output from ls was empty ({})", cmd);
    return Optional.absent();
  } else {
    return Optional.of(Integer.parseInt(output.get(0)));
  }
}
 
开发者ID:HubSpot,项目名称:Singularity,代码行数:12,代码来源:SingularityExecutorThreadChecker.java

示例8: isOk

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
public boolean isOk() {
    return logger.getClass() != NOPLogger.class;
}
 
开发者ID:yangfuhai,项目名称:jboot,代码行数:4,代码来源:Slf4jLogger.java

示例9: getLogger

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
public static Logger getLogger() {
	if ((instance == null) || (instance.logger == null))
		return NOPLogger.NOP_LOGGER;
	else
		return instance.logger;
}
 
开发者ID:AuraDevelopmentTeam,项目名称:AuraSunDial,代码行数:7,代码来源:AuraSunDial.java

示例10: getLogger

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
public Logger getLogger(String name) {
    return NOPLogger.NOP_LOGGER;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:4,代码来源:NOPLoggerFactory.java

示例11: testLogger

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
public void testLogger() {
    Logger logger = LoggerFactory.getLogger(NoBindingTest.class);
    logger.debug("hello" + diff);
    assertTrue(logger instanceof NOPLogger);
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:6,代码来源:NoBindingTest.java

示例12: beforeEach

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
@Before
public void beforeEach() {
    resolver = new DatabaseRealmResolver(DIRECTORY_PATH, null, null, System::currentTimeMillis, NOPLogger.NOP_LOGGER);
}
 
开发者ID:rhauch,项目名称:debezium-proto,代码行数:5,代码来源:DatabaseRealmResolverTest.java

示例13: dontFailOnNoCloseMethod

import org.slf4j.helpers.NOPLogger; //导入依赖的package包/类
@Test
public void dontFailOnNoCloseMethod() {
	SafeCloseUtil.close(new Object(), NOPLogger.NOP_LOGGER);
}
 
开发者ID:phicode,项目名称:philib,代码行数:5,代码来源:SafeCloseUtilTest.java


注:本文中的org.slf4j.helpers.NOPLogger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。