io.airlift.log.Logger.rawMessageFor()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(191)

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

Logger.rawMessageFor介绍

暂无

代码示例

代码示例来源:origin: com.teradata.airlift/log

/**
 * Logs a message at WARN level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.warn(e, "something bad happened when connecting to %s:%d", host, port);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the warning being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void warn(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(WARNING)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("WARN", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(WARNING, message, exception);
  }
}

代码示例来源:origin: io.airlift/log

/**
 * Logs a message at DEBUG level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.debug("value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void debug(String format, Object... args)
{
  if (logger.isLoggable(FINE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.fine(message);
  }
}

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

/**
 * Logs a message at DEBUG level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.debug("value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void debug(String format, Object... args)
{
  if (logger.isLoggable(FINE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.fine(message);
  }
}

代码示例来源:origin: io.airlift/log

/**
 * Logs a message at INFO level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.info("value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void info(String format, Object... args)
{
  if (logger.isLoggable(INFO)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("INFO", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.info(message);
  }
}

代码示例来源:origin: com.teradata.airlift/log

/**
 * Logs a message at DEBUG level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.debug("value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void debug(String format, Object... args)
{
  if (logger.isLoggable(FINE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.fine(message);
  }
}

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

/**
 * Logs a message at DEBUG level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.debug(e, "value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the debug message being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void debug(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(FINE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(FINE, message, exception);
  }
}

代码示例来源:origin: io.airlift/log

/**
 * Logs a message at DEBUG level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.debug(e, "value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the debug message being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void debug(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(FINE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(FINE, message, exception);
  }
}

代码示例来源:origin: com.teradata.airlift/log

/**
 * Logs a message at INFO level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.info("value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void info(String format, Object... args)
{
  if (logger.isLoggable(INFO)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("INFO", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.info(message);
  }
}

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

/**
 * Logs a message at ERROR level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.error(e, "something really bad happened when connecting to %s:%d", host, port);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the error being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void error(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(SEVERE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("ERROR", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(SEVERE, message, exception);
  }
}

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

/**
 * Logs a message at INFO level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.info("value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void info(String format, Object... args)
{
  if (logger.isLoggable(INFO)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("INFO", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.info(message);
  }
}

代码示例来源:origin: com.teradata.airlift/log

/**
 * Logs a message at DEBUG level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.debug(e, "value is %s (%d ms)", value, time);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the debug message being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void debug(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(FINE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(FINE, message, exception);
  }
}

代码示例来源:origin: com.teradata.airlift/log

/**
 * Logs a message at ERROR level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.error(e, "something really bad happened when connecting to %s:%d", host, port);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the error being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void error(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(SEVERE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("ERROR", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(SEVERE, message, exception);
  }
}

代码示例来源:origin: io.airlift/log

/**
 * Logs a message at WARN level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.warn(e, "something bad happened when connecting to %s:%d", host, port);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the warning being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void warn(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(WARNING)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("WARN", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(WARNING, message, exception);
  }
}

代码示例来源:origin: io.airlift/log

/**
 * Logs a message at ERROR level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.error(e, "something really bad happened when connecting to %s:%d", host, port);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the error being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void error(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(SEVERE)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("ERROR", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(SEVERE, message, exception);
  }
}

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

/**
 * Logs a message at WARN level.
 * <p>
 * Usage example:
 * <pre>
 *    logger.warn(e, "something bad happened when connecting to %s:%d", host, port);
 * </pre>
 * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
 * will continue.
 *
 * @param exception an exception associated with the warning being logged
 * @param format a format string compatible with String.format()
 * @param args arguments for the format string
 */
public void warn(Throwable exception, String format, Object... args)
{
  if (logger.isLoggable(WARNING)) {
    String message;
    try {
      message = format(format, args);
    }
    catch (IllegalFormatException e) {
      logger.log(SEVERE, illegalFormatMessageFor("WARN", format, args), e);
      message = rawMessageFor(format, args);
    }
    logger.log(WARNING, message, exception);
  }
}

相关文章