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

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

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

Logger.isWarnEnabled介绍

[英]Returns true if WARN level is enabled.
[中]如果启用了警告级别,则返回true

代码示例

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

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

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

  1. /**
  2. * Logs a message at WARN level.
  3. */
  4. default void warn(final Supplier<String> messageSupplier, final Throwable throwable) {
  5. if (isWarnEnabled()) {
  6. warn(messageSupplier.get(), throwable);
  7. }
  8. }

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

  1. if (log.isWarnEnabled()) {
  2. log.warn("Alias not found: " + aliasName);

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

  1. /**
  2. * Resolves column db sql type and populates it in column descriptor if missing.
  3. */
  4. protected void resolveColumnDbSqlType(final Connection connection, final DbEntityColumnDescriptor dec) {
  5. if (dec.dbSqlType != SqlType.DB_SQLTYPE_UNKNOWN) {
  6. return;
  7. }
  8. ResultSet rs = null;
  9. DbEntityDescriptor ded = dec.getDbEntityDescriptor();
  10. try {
  11. DatabaseMetaData dmd = connection.getMetaData();
  12. rs = dmd.getColumns(null, ded.getSchemaName(), ded.getTableName(), dec.getColumnName());
  13. if (rs.next()) {
  14. dec.dbSqlType = rs.getInt("DATA_TYPE");
  15. } else {
  16. dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
  17. if (log.isWarnEnabled()) {
  18. log.warn("Column SQL type not available: " + ded.toString() + '.' + dec.getColumnName());
  19. }
  20. }
  21. } catch (SQLException sex) {
  22. dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
  23. if (log.isWarnEnabled()) {
  24. log.warn("Column SQL type not resolved: " + ded.toString() + '.' + dec.getColumnName(), sex);
  25. }
  26. } finally {
  27. DbUtil.close(rs);
  28. }
  29. }

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

  1. throw ioex;
  2. if (log.isWarnEnabled()) {
  3. log.warn("Download failed: " + src + "; " + ioex.getMessage());
  4. throw ioex;
  5. if (log.isWarnEnabled()) {
  6. log.warn(ioex.getMessage());
  7. throw ioex;
  8. if (log.isWarnEnabled()) {
  9. log.warn("Download failed: " + localUrl + "; " + ioex.getMessage());

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

  1. if (log.isWarnEnabled()) {
  2. log.warn(createMixingMessage(targetBeanDefinition, refBeanDefinition));

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

  1. @Test
  2. void testIsLevelEnabled() {
  3. // Loggers does not provide any API to enable levels.
  4. // Instead we need to use log/level(trace/debug etc) API to log information into corresponding level
  5. assertFalse(logger.isTraceEnabled());
  6. assertFalse(logger.isDebugEnabled());
  7. assertFalse(logger.isInfoEnabled());
  8. assertFalse(logger.isWarnEnabled());
  9. assertFalse(logger.isErrorEnabled());
  10. }

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

  1. @Override
  2. @Test
  3. void testIsLevelEnabled() {
  4. //when
  5. initializeLogFactoryAndLogger(Logger.Level.DEBUG);
  6. //then
  7. assertTrue(logger.isDebugEnabled());
  8. //when
  9. initializeLogFactoryAndLogger(Logger.Level.ERROR);
  10. //then
  11. assertTrue(logger.isErrorEnabled());
  12. //when
  13. initializeLogFactoryAndLogger(Logger.Level.INFO);
  14. //then
  15. assertTrue(logger.isInfoEnabled());
  16. //when
  17. initializeLogFactoryAndLogger(Logger.Level.TRACE);
  18. //then
  19. assertTrue(logger.isTraceEnabled());
  20. //when
  21. initializeLogFactoryAndLogger(Logger.Level.WARN);
  22. //then
  23. assertTrue(logger.isWarnEnabled());
  24. }

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

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

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

  1. /**
  2. * Logs a message at WARN level.
  3. */
  4. default void warn(final Supplier<String> messageSupplier, final Throwable throwable) {
  5. if (isWarnEnabled()) {
  6. warn(messageSupplier.get(), throwable);
  7. }
  8. }

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

  1. /**
  2. * Resolves column db sql type and populates it in column descriptor if missing.
  3. */
  4. protected void resolveColumnDbSqlType(final Connection connection, final DbEntityColumnDescriptor dec) {
  5. if (dec.dbSqlType != SqlType.DB_SQLTYPE_UNKNOWN) {
  6. return;
  7. }
  8. ResultSet rs = null;
  9. DbEntityDescriptor ded = dec.getDbEntityDescriptor();
  10. try {
  11. DatabaseMetaData dmd = connection.getMetaData();
  12. rs = dmd.getColumns(null, ded.getSchemaName(), ded.getTableName(), dec.getColumnName());
  13. if (rs.next()) {
  14. dec.dbSqlType = rs.getInt("DATA_TYPE");
  15. } else {
  16. dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
  17. if (log.isWarnEnabled()) {
  18. log.warn("Column SQL type not available: " + ded.toString() + '.' + dec.getColumnName());
  19. }
  20. }
  21. } catch (SQLException sex) {
  22. dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
  23. if (log.isWarnEnabled()) {
  24. log.warn("Column SQL type not resolved: " + ded.toString() + '.' + dec.getColumnName(), sex);
  25. }
  26. } finally {
  27. DbUtil.close(rs);
  28. }
  29. }

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

  1. throw ioex;
  2. if (log.isWarnEnabled()) {
  3. log.warn("Download failed: " + src + "; " + ioex.getMessage());
  4. throw ioex;
  5. if (log.isWarnEnabled()) {
  6. log.warn(ioex.getMessage());
  7. throw ioex;
  8. if (log.isWarnEnabled()) {
  9. log.warn("Download failed: " + localUrl + "; " + ioex.getMessage());

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

  1. if (log.isWarnEnabled()) {
  2. log.warn(createMixingMessage(targetBeanDefinition, refBeanDefinition));

相关文章