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

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

本文整理了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

  1. /**
  2. * Logs a message at TRACE level.
  3. */
  4. default void trace(final Supplier<String> messageSupplier) {
  5. if (isTraceEnabled()) {
  6. trace(messageSupplier.get());
  7. }
  8. }

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

  1. @Test
  2. void testLevel() {
  3. //when
  4. logger.trace(LoggerConstants.TRACE_MESSAGE);
  5. //then
  6. verify(log).trace(LoggerConstants.TRACE_MESSAGE);
  7. //when
  8. logger.debug(LoggerConstants.DEBUG_MESSAGE);
  9. //then
  10. verify(log).debug(LoggerConstants.DEBUG_MESSAGE);
  11. //when
  12. logger.info(LoggerConstants.INFO_MESSAGE);
  13. //then
  14. verify(log).info(LoggerConstants.INFO_MESSAGE);
  15. //when
  16. logger.warn(LoggerConstants.WARN_MESSAGE);
  17. //then
  18. verify(log).warn(LoggerConstants.WARN_MESSAGE);
  19. //when
  20. logger.error(LoggerConstants.ERROR_MESSAGE);
  21. //then
  22. verify(log).error(LoggerConstants.ERROR_MESSAGE);
  23. }

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

  1. @Test
  2. void testLevel() {
  3. //when
  4. logger.trace(LoggerConstants.TRACE_MESSAGE);
  5. //then
  6. verify(log).log(java.util.logging.Level.FINER, LoggerConstants.TRACE_MESSAGE);
  7. //when
  8. logger.debug(LoggerConstants.DEBUG_MESSAGE);
  9. //then
  10. verify(log).log(java.util.logging.Level.FINE, LoggerConstants.DEBUG_MESSAGE);
  11. //when
  12. logger.info(LoggerConstants.INFO_MESSAGE);
  13. //then
  14. verify(log).log(java.util.logging.Level.INFO, LoggerConstants.INFO_MESSAGE);
  15. //when
  16. logger.warn(LoggerConstants.WARN_MESSAGE);
  17. //then
  18. verify(log).log(java.util.logging.Level.WARNING, LoggerConstants.WARN_MESSAGE);
  19. //when
  20. logger.error(LoggerConstants.ERROR_MESSAGE);
  21. //then
  22. verify(log).log(java.util.logging.Level.SEVERE, LoggerConstants.ERROR_MESSAGE);
  23. }

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

  1. @Test
  2. void testLevel() {
  3. //when
  4. logger.trace(LoggerConstants.TRACE_MESSAGE);
  5. //then
  6. verify(log).trace(LoggerConstants.TRACE_MESSAGE);
  7. //when
  8. logger.debug(LoggerConstants.DEBUG_MESSAGE);
  9. //then
  10. verify(log).debug(LoggerConstants.DEBUG_MESSAGE);
  11. //when
  12. logger.info(LoggerConstants.INFO_MESSAGE);
  13. //then
  14. verify(log).info(LoggerConstants.INFO_MESSAGE);
  15. //when
  16. logger.warn(LoggerConstants.WARN_MESSAGE);
  17. //then
  18. verify(log).warn(LoggerConstants.WARN_MESSAGE);
  19. //when
  20. logger.error(LoggerConstants.ERROR_MESSAGE);
  21. //then
  22. verify(log).error(LoggerConstants.ERROR_MESSAGE);
  23. }

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

  1. @Test
  2. void testLevel() {
  3. //when
  4. logger.trace(LoggerConstants.TRACE_MESSAGE);
  5. //then
  6. verify(log).trace(LoggerConstants.TRACE_MESSAGE);
  7. //when
  8. logger.debug(LoggerConstants.DEBUG_MESSAGE);
  9. //then
  10. verify(log).debug(LoggerConstants.DEBUG_MESSAGE);
  11. //when
  12. logger.info(LoggerConstants.INFO_MESSAGE);
  13. //then
  14. verify(log).info(LoggerConstants.INFO_MESSAGE);
  15. //when
  16. logger.warn(LoggerConstants.WARN_MESSAGE);
  17. //then
  18. verify(log).warn(LoggerConstants.WARN_MESSAGE);
  19. //when
  20. logger.error(LoggerConstants.ERROR_MESSAGE);
  21. //then
  22. verify(log).error(LoggerConstants.ERROR_MESSAGE);
  23. }

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

  1. logger.trace(LoggerConstants.TRACE_MESSAGE);

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

  1. @Test
  2. void testLog() {
  3. //given
  4. throwable = mock(Throwable.class);
  5. //when
  6. //The below methods are no op methods in actual implementations.
  7. //so we will not be able to verify anything
  8. logger.log(Level.DEBUG, name);
  9. logger.trace(name);
  10. logger.debug(name);
  11. logger.info(name);
  12. logger.warn(name);
  13. logger.warn(name, throwable);
  14. logger.error(name);
  15. logger.error(name, throwable);
  16. }

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

  1. /**
  2. * Logs a message at TRACE level.
  3. */
  4. default void trace(final Supplier<String> messageSupplier) {
  5. if (isTraceEnabled()) {
  6. trace(messageSupplier.get());
  7. }
  8. }

相关文章