本文整理匯總了Java中org.slf4j.spi.LocationAwareLogger.DEBUG_INT屬性的典型用法代碼示例。如果您正苦於以下問題:Java LocationAwareLogger.DEBUG_INT屬性的具體用法?Java LocationAwareLogger.DEBUG_INT怎麽用?Java LocationAwareLogger.DEBUG_INT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.slf4j.spi.LocationAwareLogger
的用法示例。
在下文中一共展示了LocationAwareLogger.DEBUG_INT屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: log
@Override
public void log(Marker marker, String callerFQCN, int level, String msg, Object[] argArray, Throwable t) {
Level log4jLevel;
switch (level) {
case LocationAwareLogger.TRACE_INT:
log4jLevel = traceCapable ? Level.TRACE : Level.DEBUG;
break;
case LocationAwareLogger.DEBUG_INT:
log4jLevel = Level.DEBUG;
break;
case LocationAwareLogger.INFO_INT:
log4jLevel = Level.INFO;
break;
case LocationAwareLogger.WARN_INT:
log4jLevel = Level.WARN;
break;
case LocationAwareLogger.ERROR_INT:
log4jLevel = Level.ERROR;
break;
default:
throw new IllegalStateException("Level number " + level + " is not recognized.");
}
logger.log(callerFQCN, log4jLevel, msg, t);
}
示例2: slf4jLevelIntToJULLevel
private Level slf4jLevelIntToJULLevel(int slf4jLevelInt) {
Level julLevel;
switch (slf4jLevelInt) {
case LocationAwareLogger.TRACE_INT:
julLevel = Level.FINEST;
break;
case LocationAwareLogger.DEBUG_INT:
julLevel = Level.FINE;
break;
case LocationAwareLogger.INFO_INT:
julLevel = Level.INFO;
break;
case LocationAwareLogger.WARN_INT:
julLevel = Level.WARNING;
break;
case LocationAwareLogger.ERROR_INT:
julLevel = Level.SEVERE;
break;
default:
throw new IllegalStateException("Level number " + slf4jLevelInt + " is not recognized.");
}
return julLevel;
}
示例3: log
@Override
public void log(String fqcn, Level level, Throwable t, String format, Object... arguments) {
int level_int;
switch (level) {
case TRACE:
level_int = LocationAwareLogger.TRACE_INT;
break;
case DEBUG:
level_int = LocationAwareLogger.DEBUG_INT;
break;
case INFO:
level_int = LocationAwareLogger.INFO_INT;
break;
case WARN:
level_int = LocationAwareLogger.WARN_INT;
break;
case ERROR:
level_int = LocationAwareLogger.ERROR_INT;
break;
default:
throw new Error(StringKit.format("Can not identify level: {}", level));
}
this.locationAwareLog(fqcn, level_int, t, format, arguments);
}
示例4: differentiatedLog
void differentiatedLog(Marker marker, String fqcn, int level, Object message, Throwable t) {
String m = convertToString(message);
if (locationAwareLogger != null) {
locationAwareLogger.log(marker, fqcn, level, m, null, t);
} else {
switch (level) {
case LocationAwareLogger.TRACE_INT:
slf4jLogger.trace(marker, m);
break;
case LocationAwareLogger.DEBUG_INT:
slf4jLogger.debug(marker, m);
break;
case LocationAwareLogger.INFO_INT:
slf4jLogger.info(marker, m);
break;
case LocationAwareLogger.WARN_INT:
slf4jLogger.warn(marker, m);
break;
case LocationAwareLogger.ERROR_INT:
slf4jLogger.error(marker, m);
break;
}
}
}
示例5: priorityToLevelInt
private int priorityToLevelInt(Priority p) {
switch (p.level) {
case Level.TRACE_INT:
case Level.X_TRACE_INT:
return LocationAwareLogger.TRACE_INT;
case Priority.DEBUG_INT:
return LocationAwareLogger.DEBUG_INT;
case Priority.INFO_INT:
return LocationAwareLogger.INFO_INT;
case Priority.WARN_INT:
return LocationAwareLogger.WARN_INT;
case Priority.ERROR_INT:
return LocationAwareLogger.ERROR_INT;
case Priority.FATAL_INT:
return LocationAwareLogger.ERROR_INT;
default:
throw new IllegalStateException("Unknown Priority " + p);
}
}
示例6: log
public void log(Marker marker, String callerFQCN, int level, String msg, Object[] argArray, Throwable t) {
Level log4jLevel;
switch (level) {
case LocationAwareLogger.TRACE_INT:
log4jLevel = traceCapable ? Level.TRACE : Level.DEBUG;
break;
case LocationAwareLogger.DEBUG_INT:
log4jLevel = Level.DEBUG;
break;
case LocationAwareLogger.INFO_INT:
log4jLevel = Level.INFO;
break;
case LocationAwareLogger.WARN_INT:
log4jLevel = Level.WARN;
break;
case LocationAwareLogger.ERROR_INT:
log4jLevel = Level.ERROR;
break;
default:
throw new IllegalStateException("Level number " + level + " is not recognized.");
}
logger.log(callerFQCN, log4jLevel, msg, t);
}
示例7: callLocationAwareLogger
protected void callLocationAwareLogger(LocationAwareLogger lal, LogRecord record) {
int julLevelValue = record.getLevel().intValue();
int slf4jLevel;
if (julLevelValue <= TRACE_LEVEL_THRESHOLD) {
slf4jLevel = LocationAwareLogger.TRACE_INT;
} else if (julLevelValue <= DEBUG_LEVEL_THRESHOLD) {
slf4jLevel = LocationAwareLogger.DEBUG_INT;
} else if (julLevelValue <= INFO_LEVEL_THRESHOLD) {
slf4jLevel = LocationAwareLogger.INFO_INT;
} else if (julLevelValue <= WARN_LEVEL_THRESHOLD) {
slf4jLevel = LocationAwareLogger.WARN_INT;
} else {
slf4jLevel = LocationAwareLogger.ERROR_INT;
}
String i18nMessage = getMessageI18N(record);
lal.log(null, FQCN, slf4jLevel, i18nMessage, null, record.getThrown());
}
示例8: fromLocationAwareLoggerInteger
/**
* Convert one of the integer values defined in {@link LocationAwareLogger}
* interface to an instance of this class, i.e. a Level.
*
* @param levelInt An integer value representing a level as defined in LocationAwareLogger
* @return an instance of this class, i.e. a Level.
* @since 1.0.1
*/
public static Level fromLocationAwareLoggerInteger(int levelInt) {
Level level;
switch (levelInt) {
case LocationAwareLogger.TRACE_INT:
level = TRACE;
break;
case LocationAwareLogger.DEBUG_INT:
level = DEBUG;
break;
case LocationAwareLogger.INFO_INT:
level = INFO;
break;
case LocationAwareLogger.WARN_INT:
level = WARN;
break;
case LocationAwareLogger.ERROR_INT:
level = ERROR;
break;
default:
throw new IllegalArgumentException(levelInt + " not a valid level value");
}
return level;
}
示例9: toLocationAwareLoggerInteger
/**
* Convert this level instance to an integer value defined in the
* {@link LocationAwareLogger} interface.
*
* @param level The level to convert to LocationAwareLogger integer
* @return int An integer corresponding to this level as defined in LocationAwareLogger
* @since 1.0.1
*/
public static int toLocationAwareLoggerInteger(Level level) {
if (level == null)
throw new IllegalArgumentException("null level parameter is not admitted");
switch (level.toInt()) {
case Level.TRACE_INT:
return LocationAwareLogger.TRACE_INT;
case Level.DEBUG_INT:
return LocationAwareLogger.DEBUG_INT;
case Level.INFO_INT:
return LocationAwareLogger.INFO_INT;
case Level.WARN_INT:
return LocationAwareLogger.WARN_INT;
case Level.ERROR_INT:
return LocationAwareLogger.ERROR_INT;
default:
throw new IllegalArgumentException(level + " not a valid level value");
}
}
示例10: log
/**
* Printing method with support for location information.
*
* @param marker The marker to be used for this event, may be null.
* @param callerFQCN The fully qualified class name of the <b>logger instance</b>, typically the logger
* class, logger bridge or a logger wrapper.
* @param level One of the level integers defined in this interface
* @param message The message for the log event
* @param t Throwable associated with the log event, may be null.
*/
@Override
public void log(Marker marker, String callerFQCN, int level, String message,
Object[] argArray, Throwable t) {
Level log4jLevel;
switch (level) {
case LocationAwareLogger.TRACE_INT:
log4jLevel = traceCapable ? Level.TRACE : Level.DEBUG;
break;
case LocationAwareLogger.DEBUG_INT:
log4jLevel = Level.DEBUG;
break;
case LocationAwareLogger.INFO_INT:
log4jLevel = Level.INFO;
break;
case LocationAwareLogger.WARN_INT:
log4jLevel = Level.WARN;
break;
case LocationAwareLogger.ERROR_INT:
log4jLevel = Level.ERROR;
break;
default:
throw new IllegalStateException("Level number " + level
+ " is not recognized.");
}
logger.log(callerFQCN, log4jLevel, message, t);
}
示例11: doLog
@Override
public void doLog(int level, String message, Object[] params, Throwable t) {
String formattedMessage = fullMessage(message);
final Object[] paramsWithThrowable;
if (t != null) {
if (params == null) {
paramsWithThrowable = new Object[1];
paramsWithThrowable[0] = t;
} else {
paramsWithThrowable = Arrays.copyOf(params, params.length + 1);
paramsWithThrowable[params.length] = t;
}
}
else {
paramsWithThrowable = params;
}
switch (level) {
case LocationAwareLogger.TRACE_INT:
logger.trace(formattedMessage, paramsWithThrowable);
break;
case LocationAwareLogger.DEBUG_INT:
logger.debug(formattedMessage, paramsWithThrowable);
break;
case LocationAwareLogger.INFO_INT:
logger.info(formattedMessage, paramsWithThrowable);
break;
case LocationAwareLogger.WARN_INT:
logger.warn(formattedMessage, paramsWithThrowable);
break;
case LocationAwareLogger.ERROR_INT:
default:
logger.error(formattedMessage, paramsWithThrowable);
break;
}
}
示例12: log
public void log(Marker marker, String callerFQCN, int level, String message, Object[] argArray, Throwable t) {
Level julLevel;
switch (level) {
case LocationAwareLogger.TRACE_INT:
julLevel = Level.FINEST;
break;
case LocationAwareLogger.DEBUG_INT:
julLevel = Level.FINE;
break;
case LocationAwareLogger.INFO_INT:
julLevel = Level.INFO;
break;
case LocationAwareLogger.WARN_INT:
julLevel = Level.WARNING;
break;
case LocationAwareLogger.ERROR_INT:
julLevel = Level.SEVERE;
break;
default:
throw new IllegalStateException("Level number " + level + " is not recognized.");
}
// the logger.isLoggable check avoids the unconditional
// construction of location data for disabled log
// statements. As of 2008-07-31, callers of this method
// do not perform this check. See also
// http://bugzilla.slf4j.org/show_bug.cgi?id=90
if (logger.isLoggable(julLevel)) {
log(callerFQCN, julLevel, message, t);
}
}
示例13: exceptionCaught
@Override
protected void exceptionCaught(Throwable cause) {
String message = "Caught exception on proxy -> web connection";
int logLevel = LocationAwareLogger.WARN_INT;
if (cause != null) {
String causeMessage = cause.getMessage();
if (cause instanceof ConnectException) {
logLevel = LocationAwareLogger.DEBUG_INT;
} else if (causeMessage != null) {
if (causeMessage.contains("Connection reset by peer")) {
logLevel = LocationAwareLogger.DEBUG_INT;
} else if (causeMessage.contains("event executor terminated")) {
logLevel = LocationAwareLogger.DEBUG_INT;
}
}
}
LOG.log(logLevel, message, cause);
if (!is(DISCONNECTED)) {
LOG.log(logLevel, "Disconnecting open connection");
disconnect();
}
// This can happen if we couldn't make the initial connection due
// to something like an unresolved address, for example, or a timeout.
// There will not have been be any requests written on an unopened
// connection, so there should not be any further action to take here.
}
示例14: log
/**
* {@inheritDoc}
*/
@Override
public void log(
final Marker marker,
final String callerFQCN,
final int level,
final String msg,
final Object[] arguments,
final Throwable throwable) {
final Object[] newArguments = getArgumentsWithThrowable(arguments, throwable);
switch (level) {
case LocationAwareLogger.TRACE_INT:
trace(msg, newArguments);
break;
case LocationAwareLogger.DEBUG_INT:
debug(msg, newArguments);
break;
case LocationAwareLogger.INFO_INT:
info(msg, newArguments);
break;
case LocationAwareLogger.WARN_INT:
warn(msg, newArguments);
break;
case LocationAwareLogger.ERROR_INT:
error(msg, newArguments);
break;
default:
throw new IllegalStateException("Level number " + level + " is not recognized.");
}
}
示例15: log
protected void log(int level, String message, Object... params) {
if (level != LocationAwareLogger.DEBUG_INT || logger.isDebugEnabled()) {
dispatch.doLog(level, message, params, null);
}
}