java.util.logging.Logger.internalIsLoggable()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中java.util.logging.Logger.internalIsLoggable()方法的一些代码示例,展示了Logger.internalIsLoggable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.internalIsLoggable()方法的具体详情如下:
包路径:java.util.logging.Logger
类名称:Logger
方法名:internalIsLoggable

Logger.internalIsLoggable介绍

[英]This method is for compatibility. Tests written to the reference implementation API imply that the isLoggable() method is not called directly. This behavior is important because subclass may override isLoggable() method, so that affect the result of log methods.
[中]此方法是为了兼容性。写入引用实现API的测试意味着不直接调用isLoggable()方法。此行为很重要,因为子类可能重写isLoggable()方法,从而影响日志方法的结果。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Determines whether this logger will actually log messages of the
 * specified level. The effective level used to do the determination may be
 * inherited from its parent. The default level is {@code Level.INFO}.
 *
 * @param l
 *            the level to check.
 * @return {@code true} if this logger will actually log this level,
 *         otherwise {@code false}.
 */
public boolean isLoggable(Level l) {
  return internalIsLoggable(l);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the specified level. The message is transmitted to all
 * subscribed handlers.
 *
 * @param logLevel
 *            the level of the specified message.
 * @param msg
 *            the message to log.
 */
public void log(Level logLevel, String msg) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  dalvikLogHandler.publish(this, androidTag, logLevel, msg);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message indicating that a method has been entered. A log record
 * with log level {@code Level.FINER}, log message "ENTRY", the specified
 * source class name and source method name is submitted for logging.
 *
 * @param sourceClass
 *            the calling class name.
 * @param sourceMethod
 *            the method name.
 */
public void entering(String sourceClass, String sourceMethod) {
  if (!internalIsLoggable(Level.FINER)) {
    return;
  }
  LogRecord record = new LogRecord(Level.FINER, "ENTRY");
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message indicating that a method is exited. A log record with log
 * level {@code Level.FINER}, log message "RETURN", the specified source
 * class name and source method name is submitted for logging.
 *
 * @param sourceClass
 *            the calling class name.
 * @param sourceMethod
 *            the method name.
 */
public void exiting(String sourceClass, String sourceMethod) {
  if (!internalIsLoggable(Level.FINER)) {
    return;
  }
  LogRecord record = new LogRecord(Level.FINER, "RETURN");
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the specified level with the supplied {@code Throwable}
 * object. The message is then transmitted to all subscribed handlers.
 *
 * @param logLevel
 *            the level of the given message.
 * @param msg
 *            the message to log.
 * @param thrown
 *            the {@code Throwable} object associated with the event that is
 *            logged.
 */
public void log(Level logLevel, String msg, Throwable thrown) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setThrown(thrown);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the given level with the specified source class name
 * and source method name.
 *
 * @param logLevel
 *            the level of the given message.
 * @param sourceClass
 *            the source class name.
 * @param sourceMethod
 *            the source method name.
 * @param msg
 *            the message to be logged.
 */
public void logp(Level logLevel, String sourceClass, String sourceMethod,
    String msg) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message indicating that an exception is thrown. A log record with
 * log level {@code Level.FINER}, log message "THROW", the specified source
 * class name, source method name and the {@code Throwable} object is
 * submitted for logging.
 *
 * @param sourceClass
 *            the source class name.
 * @param sourceMethod
 *            the source method name.
 * @param thrown
 *            the {@code Throwable} object.
 */
public void throwing(String sourceClass, String sourceMethod,
    Throwable thrown) {
  if (!internalIsLoggable(Level.FINER)) {
    return;
  }
  LogRecord record = new LogRecord(Level.FINER, "THROW");
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  record.setThrown(thrown);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the given level with the specified source class name,
 * source method name and {@code Throwable} object.
 *
 * @param logLevel
 *            the level of the given message.
 * @param sourceClass
 *            the source class name.
 * @param sourceMethod
 *            the source method name.
 * @param msg
 *            the message to be logged.
 * @param thrown
 *            the {@code Throwable} object.
 */
public void logp(Level logLevel, String sourceClass, String sourceMethod,
    String msg, Throwable thrown) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  record.setThrown(thrown);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the specified level with the supplied parameter array.
 * The message is then transmitted to all subscribed handlers.
 *
 * @param logLevel
 *            the level of the given message
 * @param msg
 *            the message to log.
 * @param params
 *            the parameter array associated with the event that is logged.
 */
public void log(Level logLevel, String msg, Object[] params) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setParameters(params);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message indicating that a method has been entered. A log record
 * with log level {@code Level.FINER}, log message "ENTRY", the specified
 * source class name, source method name and one parameter is submitted for
 * logging.
 *
 * @param sourceClass
 *            the source class name.
 * @param sourceMethod
 *            the source method name.
 * @param param
 *            the parameter for the method call.
 */
public void entering(String sourceClass, String sourceMethod, Object param) {
  if (!internalIsLoggable(Level.FINER)) {
    return;
  }
  LogRecord record = new LogRecord(Level.FINER, "ENTRY" + " {0}");
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  record.setParameters(new Object[] { param });
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the specified level with the supplied parameter. The
 * message is then transmitted to all subscribed handlers.
 *
 * @param logLevel
 *            the level of the given message.
 * @param msg
 *            the message to log.
 * @param param
 *            the parameter associated with the event that is logged.
 */
public void log(Level logLevel, String msg, Object param) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setParameters(new Object[] { param });
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message indicating that a method is exited. A log record with log
 * level {@code Level.FINER}, log message "RETURN", the specified source
 * class name, source method name and return value is submitted for logging.
 *
 * @param sourceClass
 *            the source class name.
 * @param sourceMethod
 *            the source method name.
 * @param result
 *            the return value of the method call.
 */
public void exiting(String sourceClass, String sourceMethod, Object result) {
  if (!internalIsLoggable(Level.FINER)) {
    return;
  }
  LogRecord record = new LogRecord(Level.FINER, "RETURN" + " {0}");
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  record.setParameters(new Object[] { result });
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the given level with the specified source class name,
 * source method name and parameter array.
 *
 * @param logLevel
 *            the level of the given message.
 * @param sourceClass
 *            the source class name.
 * @param sourceMethod
 *            the source method name.
 * @param msg
 *            the message to be logged.
 * @param params
 *            the parameter array associated with the event that is logged.
 */
public void logp(Level logLevel, String sourceClass, String sourceMethod,
    String msg, Object[] params) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  record.setParameters(params);
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

if (!internalIsLoggable(Level.FINER)) {
  return;

代码示例来源:origin: robovm/robovm

/**
 * Logs a message of the given level with the specified source class name,
 * source method name and parameter.
 *
 * @param logLevel
 *            the level of the given message
 * @param sourceClass
 *            the source class name
 * @param sourceMethod
 *            the source method name
 * @param msg
 *            the message to be logged
 * @param param
 *            the parameter associated with the event that is logged.
 */
public void logp(Level logLevel, String sourceClass, String sourceMethod,
    String msg, Object param) {
  if (!internalIsLoggable(logLevel)) {
    return;
  }
  LogRecord record = new LogRecord(logLevel, msg);
  record.setLoggerName(this.name);
  record.setSourceClassName(sourceClass);
  record.setSourceMethodName(sourceMethod);
  record.setParameters(new Object[] { param });
  setResourceBundle(record);
  log(record);
}

代码示例来源:origin: robovm/robovm

if (!internalIsLoggable(logLevel)) {
  return;

代码示例来源:origin: robovm/robovm

if (!internalIsLoggable(logLevel)) {
  return;

代码示例来源:origin: robovm/robovm

if (!internalIsLoggable(logLevel)) {
  return;

代码示例来源:origin: robovm/robovm

if (!internalIsLoggable(logLevel)) {
  return;

代码示例来源:origin: robovm/robovm

if (!internalIsLoggable(record.getLevel())) {
  return;

相关文章