org.apache.logging.log4j.message.Message.getThrowable()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(118)

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

Message.getThrowable介绍

[英]Gets the throwable, if any.
[中]如果有的话,可以扔掉。

代码示例

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public Throwable getThrowable() {
  if (throwable != null) {
    return throwable;
  }
  if (message == null) {
    message = getMessage(messagePattern, argArray, null);
  }
  return message.getThrowable();
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void debug(final Marker marker, final Message msg) {
  logIfEnabled(FQCN, Level.DEBUG, marker, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void log(final Level level, final Marker marker, final Message msg) {
  logIfEnabled(FQCN, level, marker, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void warn(final Marker marker, final Message msg) {
  logIfEnabled(FQCN, Level.WARN, marker, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void debug(final Message msg) {
  logIfEnabled(FQCN, Level.DEBUG, null, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void fatal(final Marker marker, final Message msg) {
  logIfEnabled(FQCN, Level.FATAL, marker, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void info(final Message msg) {
  logIfEnabled(FQCN, Level.INFO, null, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void trace(final Marker marker, final Message msg) {
  logIfEnabled(FQCN, Level.TRACE, marker, msg, msg != null ? msg.getThrowable() : null);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0) {
  final Message msg = messageFactory.newMessage(message, p0);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
  final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object... params) {
  final Message msg = messageFactory.newMessage(message, params);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0, final Object p1) {
  final Message msg = messageFactory.newMessage(message, p0, p1);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
  final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
    final Object p6, final Object p7) {
  final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker,
    final MessageSupplier msgSupplier, final Throwable t) {
  final Message message = LambdaUtil.get(msgSupplier);
  logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0, final Object p1, final Object p2, final Object p3) {
  final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
    final Object p6, final Object p7, final Object p8, final Object p9) {
  final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
    final Supplier<?>... paramSuppliers) {
  final Message msg = messageFactory.newMessage(message, LambdaUtil.getAll(paramSuppliers));
  logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void printf(final Level level, final String format, final Object... params) {
  if (isEnabled(level, null, format, params)) {
    final Message msg = new StringFormattedMessage(format, params);
    logMessageSafely(FQCN, level, null, msg, msg.getThrowable());
  }
}

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
public void printf(final Level level, final Marker marker, final String format, final Object... params) {
  if (isEnabled(level, marker, format, params)) {
    final Message msg = new StringFormattedMessage(format, params);
    logMessageSafely(FQCN, level, marker, msg, msg.getThrowable());
  }
}

相关文章