jodd.log.Logger.trace()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(263)

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

Logger.trace介绍

[英]Logs a message at TRACE level.
[中]在跟踪级别记录消息。

代码示例

代码示例来源:origin: oblac/jodd

/**
 * Logs a message at TRACE level.
 */
default void trace(final Supplier<String> messageSupplier) {
  if (isTraceEnabled()) {
    trace(messageSupplier.get());
  }
}

代码示例来源:origin: oblac/jodd

@Test
void testLevel() {
  //when
  logger.trace(LoggerConstants.TRACE_MESSAGE);
  //then
  verify(log).trace(LoggerConstants.TRACE_MESSAGE);
  //when
  logger.debug(LoggerConstants.DEBUG_MESSAGE);
  //then
  verify(log).debug(LoggerConstants.DEBUG_MESSAGE);
  //when
  logger.info(LoggerConstants.INFO_MESSAGE);
  //then
  verify(log).info(LoggerConstants.INFO_MESSAGE);
  //when
  logger.warn(LoggerConstants.WARN_MESSAGE);
  //then
  verify(log).warn(LoggerConstants.WARN_MESSAGE);
  //when
  logger.error(LoggerConstants.ERROR_MESSAGE);
  //then
  verify(log).error(LoggerConstants.ERROR_MESSAGE);
}

代码示例来源:origin: oblac/jodd

@Test
void testLevel() {
  //when
  logger.trace(LoggerConstants.TRACE_MESSAGE);
  //then
  verify(log).log(java.util.logging.Level.FINER, LoggerConstants.TRACE_MESSAGE);
  //when
  logger.debug(LoggerConstants.DEBUG_MESSAGE);
  //then
  verify(log).log(java.util.logging.Level.FINE, LoggerConstants.DEBUG_MESSAGE);
  //when
  logger.info(LoggerConstants.INFO_MESSAGE);
  //then
  verify(log).log(java.util.logging.Level.INFO, LoggerConstants.INFO_MESSAGE);
  //when
  logger.warn(LoggerConstants.WARN_MESSAGE);
  //then
  verify(log).log(java.util.logging.Level.WARNING, LoggerConstants.WARN_MESSAGE);
  //when
  logger.error(LoggerConstants.ERROR_MESSAGE);
  //then
  verify(log).log(java.util.logging.Level.SEVERE, LoggerConstants.ERROR_MESSAGE);
}

代码示例来源:origin: oblac/jodd

@Test
void testLevel() {
  //when
  logger.trace(LoggerConstants.TRACE_MESSAGE);
  //then
  verify(log).trace(LoggerConstants.TRACE_MESSAGE);
  //when
  logger.debug(LoggerConstants.DEBUG_MESSAGE);
  //then
  verify(log).debug(LoggerConstants.DEBUG_MESSAGE);
  //when
  logger.info(LoggerConstants.INFO_MESSAGE);
  //then
  verify(log).info(LoggerConstants.INFO_MESSAGE);
  //when
  logger.warn(LoggerConstants.WARN_MESSAGE);
  //then
  verify(log).warn(LoggerConstants.WARN_MESSAGE);
  //when
  logger.error(LoggerConstants.ERROR_MESSAGE);
  //then
  verify(log).error(LoggerConstants.ERROR_MESSAGE);
}

代码示例来源:origin: oblac/jodd

@Test
void testLevel() {
  //when
  logger.trace(LoggerConstants.TRACE_MESSAGE);
  //then
  verify(log).trace(LoggerConstants.TRACE_MESSAGE);
  //when
  logger.debug(LoggerConstants.DEBUG_MESSAGE);
  //then
  verify(log).debug(LoggerConstants.DEBUG_MESSAGE);
  //when
  logger.info(LoggerConstants.INFO_MESSAGE);
  //then
  verify(log).info(LoggerConstants.INFO_MESSAGE);
  //when
  logger.warn(LoggerConstants.WARN_MESSAGE);
  //then
  verify(log).warn(LoggerConstants.WARN_MESSAGE);
  //when
  logger.error(LoggerConstants.ERROR_MESSAGE);
  //then
  verify(log).error(LoggerConstants.ERROR_MESSAGE);
}

代码示例来源:origin: oblac/jodd

logger.trace(LoggerConstants.TRACE_MESSAGE);

代码示例来源:origin: oblac/jodd

@Test
void testLog() {
  //given
  throwable = mock(Throwable.class);
  //when
  //The below methods are no op methods in actual implementations.
  //so we will not be able to verify anything
  logger.log(Level.DEBUG, name);
  logger.trace(name);
  logger.debug(name);
  logger.info(name);
  logger.warn(name);
  logger.warn(name, throwable);
  logger.error(name);
  logger.error(name, throwable);
}

代码示例来源:origin: org.jodd/jodd-log

/**
 * Logs a message at TRACE level.
 */
default void trace(final Supplier<String> messageSupplier) {
  if (isTraceEnabled()) {
    trace(messageSupplier.get());
  }
}

相关文章