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


Java Level.WARNING属性代码示例

本文整理汇总了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) {}
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:19,代码来源:SamaGamesAPI.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:ErrorManager.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:NetbinoxHooks.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:LogRecordsTest.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DecorableTest.java

示例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);
    }
}
 
开发者ID:satoshinm,项目名称:WebSandboxMC,代码行数:14,代码来源:SettingsSponge.java

示例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);
  }
}
 
开发者ID:google,项目名称:ios-device-control,代码行数:34,代码来源:CommandProcess.java

示例9: logLevel

@Override
protected Level logLevel() {
    return Level.WARNING;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:MenuBarNotInAWTTest.java

示例10: log

public void log(int level, String message, Throwable t) {
  Level logLevel = level == WARN ? Level.WARNING : Level.INFO;
  logger.log(logLevel, message, t);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Platform.java

示例11: warn

public void warn(String s) {
    LogRecord lr = new LogRecord(Level.WARNING, s);
    lr.setSourceClassName(log.getName());

    log.log(lr);
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:6,代码来源:JdkLoggingImpl.java

示例12: internalWarn

@Override
protected void internalWarn(String msg, Throwable cause) {
    LogRecord record = new ESLogRecord(Level.WARNING, msg);
    record.setThrown(cause);
    logger.log(record);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:JdkESLogger.java

示例13: logLevel

protected Level logLevel() {
    return Level.WARNING;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:3,代码来源:LoggingTest.java

示例14: publish

@Override
public void publish(LogRecord record) {
    if (record.getLevel() == Level.WARNING && record.getThrown() != null) {
        warning = true;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:LuceneIndexTest.java

示例15: logLevel

protected @Override Level logLevel() {
    return Level.WARNING;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:3,代码来源:AntArtifactTest.java


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