本文整理了Java中jodd.log.Logger.isWarnEnabled()
方法的一些代码示例,展示了Logger.isWarnEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.isWarnEnabled()
方法的具体详情如下:
包路径:jodd.log.Logger
类名称:Logger
方法名:isWarnEnabled
[英]Returns true
if WARN level is enabled.
[中]如果启用了警告级别,则返回true
。
代码示例来源:origin: oblac/jodd
/**
* Logs a message at WARN level.
*/
default void warn(final Supplier<String> messageSupplier) {
if (isWarnEnabled()) {
warn(messageSupplier.get());
}
}
代码示例来源:origin: oblac/jodd
/**
* Logs a message at WARN level.
*/
default void warn(final Supplier<String> messageSupplier, final Throwable throwable) {
if (isWarnEnabled()) {
warn(messageSupplier.get(), throwable);
}
}
代码示例来源:origin: oblac/jodd
if (log.isWarnEnabled()) {
log.warn("Alias not found: " + aliasName);
代码示例来源:origin: oblac/jodd
/**
* Resolves column db sql type and populates it in column descriptor if missing.
*/
protected void resolveColumnDbSqlType(final Connection connection, final DbEntityColumnDescriptor dec) {
if (dec.dbSqlType != SqlType.DB_SQLTYPE_UNKNOWN) {
return;
}
ResultSet rs = null;
DbEntityDescriptor ded = dec.getDbEntityDescriptor();
try {
DatabaseMetaData dmd = connection.getMetaData();
rs = dmd.getColumns(null, ded.getSchemaName(), ded.getTableName(), dec.getColumnName());
if (rs.next()) {
dec.dbSqlType = rs.getInt("DATA_TYPE");
} else {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not available: " + ded.toString() + '.' + dec.getColumnName());
}
}
} catch (SQLException sex) {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not resolved: " + ded.toString() + '.' + dec.getColumnName(), sex);
}
} finally {
DbUtil.close(rs);
}
}
代码示例来源:origin: oblac/jodd
throw ioex;
if (log.isWarnEnabled()) {
log.warn("Download failed: " + src + "; " + ioex.getMessage());
throw ioex;
if (log.isWarnEnabled()) {
log.warn(ioex.getMessage());
throw ioex;
if (log.isWarnEnabled()) {
log.warn("Download failed: " + localUrl + "; " + ioex.getMessage());
代码示例来源:origin: oblac/jodd
if (log.isWarnEnabled()) {
log.warn(createMixingMessage(targetBeanDefinition, refBeanDefinition));
代码示例来源:origin: oblac/jodd
@Test
void testIsLevelEnabled() {
// Loggers does not provide any API to enable levels.
// Instead we need to use log/level(trace/debug etc) API to log information into corresponding level
assertFalse(logger.isTraceEnabled());
assertFalse(logger.isDebugEnabled());
assertFalse(logger.isInfoEnabled());
assertFalse(logger.isWarnEnabled());
assertFalse(logger.isErrorEnabled());
}
代码示例来源:origin: oblac/jodd
@Override
@Test
void testIsLevelEnabled() {
//when
initializeLogFactoryAndLogger(Logger.Level.DEBUG);
//then
assertTrue(logger.isDebugEnabled());
//when
initializeLogFactoryAndLogger(Logger.Level.ERROR);
//then
assertTrue(logger.isErrorEnabled());
//when
initializeLogFactoryAndLogger(Logger.Level.INFO);
//then
assertTrue(logger.isInfoEnabled());
//when
initializeLogFactoryAndLogger(Logger.Level.TRACE);
//then
assertTrue(logger.isTraceEnabled());
//when
initializeLogFactoryAndLogger(Logger.Level.WARN);
//then
assertTrue(logger.isWarnEnabled());
}
代码示例来源:origin: org.jodd/jodd-log
/**
* Logs a message at WARN level.
*/
default void warn(final Supplier<String> messageSupplier) {
if (isWarnEnabled()) {
warn(messageSupplier.get());
}
}
代码示例来源:origin: org.jodd/jodd-log
/**
* Logs a message at WARN level.
*/
default void warn(final Supplier<String> messageSupplier, final Throwable throwable) {
if (isWarnEnabled()) {
warn(messageSupplier.get(), throwable);
}
}
代码示例来源:origin: org.jodd/jodd-db
/**
* Resolves column db sql type and populates it in column descriptor if missing.
*/
protected void resolveColumnDbSqlType(final Connection connection, final DbEntityColumnDescriptor dec) {
if (dec.dbSqlType != SqlType.DB_SQLTYPE_UNKNOWN) {
return;
}
ResultSet rs = null;
DbEntityDescriptor ded = dec.getDbEntityDescriptor();
try {
DatabaseMetaData dmd = connection.getMetaData();
rs = dmd.getColumns(null, ded.getSchemaName(), ded.getTableName(), dec.getColumnName());
if (rs.next()) {
dec.dbSqlType = rs.getInt("DATA_TYPE");
} else {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not available: " + ded.toString() + '.' + dec.getColumnName());
}
}
} catch (SQLException sex) {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not resolved: " + ded.toString() + '.' + dec.getColumnName(), sex);
}
} finally {
DbUtil.close(rs);
}
}
代码示例来源:origin: org.jodd/jodd-htmlstapler
throw ioex;
if (log.isWarnEnabled()) {
log.warn("Download failed: " + src + "; " + ioex.getMessage());
throw ioex;
if (log.isWarnEnabled()) {
log.warn(ioex.getMessage());
throw ioex;
if (log.isWarnEnabled()) {
log.warn("Download failed: " + localUrl + "; " + ioex.getMessage());
代码示例来源:origin: org.jodd/jodd-petite
if (log.isWarnEnabled()) {
log.warn(createMixingMessage(targetBeanDefinition, refBeanDefinition));
内容来源于网络,如有侵权,请联系作者删除!