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


Java NOPLogger.NOP_LOGGER属性代码示例

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


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

示例1: getLogger

/**
 * {@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,代码行数:19,代码来源:CasLoggerFactory.java

示例2: getLogger

/**
 * {@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,代码行数:19,代码来源:CasLoggerFactory.java

示例3: LoggingSlf4jImpl

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,代码行数:14,代码来源:LoggingSlf4jImpl.java

示例4: processLog

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,代码行数:35,代码来源:DefaultLogsProcessorService.java

示例5: getNumThreadsFromCommand

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,代码行数:11,代码来源:SingularityExecutorThreadChecker.java

示例6: getLogger

public static Logger getLogger() {
	if ((instance == null) || (instance.logger == null))
		return NOPLogger.NOP_LOGGER;
	else
		return instance.logger;
}
 
开发者ID:AuraDevelopmentTeam,项目名称:AuraSunDial,代码行数:6,代码来源:AuraSunDial.java

示例7: getLogger

public Logger getLogger(String name) {
    return NOPLogger.NOP_LOGGER;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:3,代码来源:NOPLoggerFactory.java

示例8: beforeEach

@Before
public void beforeEach() {
    resolver = new DatabaseRealmResolver(DIRECTORY_PATH, null, null, System::currentTimeMillis, NOPLogger.NOP_LOGGER);
}
 
开发者ID:rhauch,项目名称:debezium-proto,代码行数:4,代码来源:DatabaseRealmResolverTest.java


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