本文整理汇总了Java中java.util.logging.Level.WARNING属性的典型用法代码示例。如果您正苦于以下问题:Java Level.WARNING属性的具体用法?Java Level.WARNING怎么用?Java Level.WARNING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.util.logging.Level
的用法示例。
在下文中一共展示了Level.WARNING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: slackLog
public void slackLog(Level level, SlackMessage message)
{
String color;
if (level == Level.FINE)
color = "#2FA44F";
else if (level == Level.WARNING)
color = "#DE9E31";
else if (level == Level.SEVERE)
color = "#D50200";
else
color = "#28D7E5";
try
{
this.getSlackLogsPublisher().push(new SlackAttachment("").color(color).text(message));
}
catch (IOException ignored) {}
}
示例2: convertSeverity
private static Level convertSeverity(final int severity, boolean forException, Level def) {
Level sev = def;
if (severity >= ERROR) {
sev = Level.SEVERE;
} else if (severity >= EXCEPTION) {
sev = Level.SEVERE;
} else if (severity >= USER) {
sev = OwnLevel.USER;
} else if (severity >= WARNING) {
sev = Level.WARNING;
} else if (severity >= INFORMATIONAL) {
sev = forException ? Level.INFO: Level.FINE;
}
return sev;
}
示例3: toJULLogLevel
private Level toJULLogLevel(String logLevel) {
if (logLevel == null) {
return null;
}
try {
return Level.parse(logLevel);
}
catch (IllegalArgumentException e) {
if (logLevel.equalsIgnoreCase("DEBUG")) {
return Level.FINE;
}
if (logLevel.equalsIgnoreCase("WARN")) {
return Level.WARNING;
}
throw new IllegalArgumentException("Unresolved log level " + logLevel + " for java.util.logging", e);
}
}
开发者ID:gavlyukovskiy,项目名称:spring-boot-data-source-decorator,代码行数:17,代码来源:ProxyDataSourceBuilderConfigurer.java
示例4: log
@Override
public void log(FrameworkEvent fe) {
Level l = Level.FINE;
if ((fe.getType() & FrameworkEvent.ERROR) != 0) {
l = Level.SEVERE;
} else if ((fe.getType() & FrameworkEvent.WARNING) != 0) {
l = Level.WARNING;
} else if ((fe.getType() & FrameworkEvent.INFO) != 0) {
l = Level.INFO;
}
LogRecord lr = new LogRecord(l, "framework event {0} type {1}");
lr.setParameters(new Object[]{fe.getBundle().getSymbolicName(), fe.getType()});
lr.setThrown(fe.getThrowable());
lr.setLoggerName(NetbinoxFactory.LOG.getName());
NetbinoxFactory.LOG.log(lr);
}
示例5: randomLevel
private static Level randomLevel(Random r) {
int lev = r.nextInt(1100);
if (lev >= Level.SEVERE.intValue()) return Level.SEVERE;
if (lev >= Level.WARNING.intValue()) return Level.WARNING;
if (lev >= Level.INFO.intValue()) return Level.INFO;
if (lev >= Level.CONFIG.intValue()) return Level.CONFIG;
if (lev >= Level.FINE.intValue()) return Level.FINE;
if (lev >= Level.FINER.intValue()) return Level.FINER;
if (lev >= Level.FINEST.intValue()) return Level.FINEST;
return Level.OFF;
}
示例6: testHasNonNullNameWhenMessageIsGiven
public void testHasNonNullNameWhenMessageIsGiven() throws Exception {
Exception my = new Exception("Ahoj");
LogRecord r = new LogRecord(Level.WARNING, my.getMessage());
r.setThrown(my);
Node n = UINode.create(r);
assertNotNull(n);
assertNotNull(n.getName());
assertSerializedWell(r, n);
}
示例7: log
@Override
public void log(Level level, String message) {
if (level == Level.FINEST && !debug) {
return;
}
if (level == Level.FINEST) {
plugin.logger.debug(message);
} else if (level == Level.WARNING) {
plugin.logger.warn(message);
} else {
plugin.logger.info(message);
}
}
示例8: CommandProcess
protected CommandProcess(Command command, RawProcess rawProcess) throws CommandStartException {
this.command = checkNotNull(command);
this.rawProcess = checkNotNull(rawProcess);
stdoutStream = new CapturingOutputStream();
stderrStream = new CapturingOutputStream();
Supplier<Level> ioLogLevel = new Supplier<Level>() {
@Override
public Level get() {
return CommandProcess.this.rawProcess.isAlive() ? Level.WARNING : Level.FINE;
}
};
try {
stdinPump =
maybeStartCopyFromSourceToPipe(command.stdinSource(), rawProcess.stdinPipe(), ioLogLevel);
stdoutPump =
maybeStartCopyFromPipeToSink(
rawProcess.stdoutPipe(),
command.stdoutSink(),
stdoutStream,
stderrStream,
ioLogLevel);
stderrPump =
maybeStartCopyFromPipeToSink(
rawProcess.stderrPipe(),
command.stderrSink(),
stdoutStream,
stderrStream,
ioLogLevel);
} catch (IOException e) {
throw new CommandStartException(command, e);
}
}
示例9: logLevel
@Override
protected Level logLevel() {
return Level.WARNING;
}
示例10: log
public void log(int level, String message, Throwable t) {
Level logLevel = level == WARN ? Level.WARNING : Level.INFO;
logger.log(logLevel, message, t);
}
示例11: warn
public void warn(String s) {
LogRecord lr = new LogRecord(Level.WARNING, s);
lr.setSourceClassName(log.getName());
log.log(lr);
}
示例12: internalWarn
@Override
protected void internalWarn(String msg, Throwable cause) {
LogRecord record = new ESLogRecord(Level.WARNING, msg);
record.setThrown(cause);
logger.log(record);
}
示例13: logLevel
protected Level logLevel() {
return Level.WARNING;
}
示例14: publish
@Override
public void publish(LogRecord record) {
if (record.getLevel() == Level.WARNING && record.getThrown() != null) {
warning = true;
}
}
示例15: logLevel
protected @Override Level logLevel() {
return Level.WARNING;
}