本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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)));
}
}
示例6: getLogger
public static Logger getLogger() {
if ((instance == null) || (instance.logger == null))
return NOPLogger.NOP_LOGGER;
else
return instance.logger;
}
示例7: getLogger
public Logger getLogger(String name) {
return NOPLogger.NOP_LOGGER;
}
示例8: beforeEach
@Before
public void beforeEach() {
resolver = new DatabaseRealmResolver(DIRECTORY_PATH, null, null, System::currentTimeMillis, NOPLogger.NOP_LOGGER);
}