Java Code Examples for org.slf4j.spi.LocationAwareLogger#DEBUG_INT

The following examples show how to use org.slf4j.spi.LocationAwareLogger#DEBUG_INT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SLF4JLogger.java    From logging-log4j2 with Apache License 2.0 6 votes vote down vote up
private int convertLevel(final Level level) {
    switch (level.getStandardLevel()) {
        case DEBUG :
            return LocationAwareLogger.DEBUG_INT;
        case TRACE :
            return LocationAwareLogger.TRACE_INT;
        case INFO :
            return LocationAwareLogger.INFO_INT;
        case WARN :
            return LocationAwareLogger.WARN_INT;
        case ERROR :
            return LocationAwareLogger.ERROR_INT;
        default :
            return LocationAwareLogger.ERROR_INT;
    }
}
 
Example 2
Source File: Log4jLoggerAdapter.java    From HttpSessionReplacer with MIT License 6 votes vote down vote up
@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);
}
 
Example 3
Source File: JDK14LoggerAdapter.java    From HttpSessionReplacer with MIT License 6 votes vote down vote up
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;
}
 
Example 4
Source File: ProxyConnectionLogger.java    From g4proxy with Apache License 2.0 5 votes vote down vote up
@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;
    }
}
 
Example 5
Source File: Slf4jLogger_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public static int getSlf4jLevel(Level level) {
  switch(level.toInteger()) {
  case Level.SEVERE_INT: return LocationAwareLogger.ERROR_INT;
  case Level.WARNING_INT: return LocationAwareLogger.WARN_INT;
  case Level.INFO_INT: return LocationAwareLogger.INFO_INT;
  case Level.CONFIG_INT: return LocationAwareLogger.INFO_INT;
  case Level.FINE_INT: return LocationAwareLogger.DEBUG_INT;
  case Level.FINER_INT: return LocationAwareLogger.TRACE_INT;
  case Level.FINEST_INT: return LocationAwareLogger.TRACE_INT;
  }
  Misc.internalError();
  return LocationAwareLogger.ERROR_INT; //ignored, just here for compile error avoidance
}
 
Example 6
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(String format, Object arg1, Object arg2) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(format, arg1, arg2);
	}
}
 
Example 7
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(Marker marker, String msg, Throwable t) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(marker, msg, t);
	}
}
 
Example 8
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(Marker marker, String format, Object... arguments) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(marker, format, arguments);
	}
}
 
Example 9
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(Marker marker, String format, Object arg1, Object arg2) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(marker, format, arg1, arg2);
	}
}
 
Example 10
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(Marker marker, String format, Object arg) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(marker, format, arg);
	}
}
 
Example 11
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(Marker marker, String msg) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(marker, msg);
	}
}
 
Example 12
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(String msg, Throwable t) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(msg, t);
	}
}
 
Example 13
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(String format, Object... arguments) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(format, arguments);
	}
}
 
Example 14
Source File: ProxyConnectionLogger.java    From g4proxy with Apache License 2.0 4 votes vote down vote up
protected void log(int level, String message, Object... params) {
    if (level != LocationAwareLogger.DEBUG_INT || logger.isDebugEnabled()) {
        dispatch.doLog(level, message, params, null);
    }
}
 
Example 15
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(String format, Object arg) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(format, arg);
	}
}
 
Example 16
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void debug(String msg) {
	if (getLevel() <= LocationAwareLogger.DEBUG_INT) {
		delegate.debug(msg);
	}
}
 
Example 17
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean isDebugEnabled(Marker marker) {
	return getLevel() <= LocationAwareLogger.DEBUG_INT
			&& delegate.isDebugEnabled(marker);
}
 
Example 18
Source File: LevelledLoggerWrapper.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public boolean isDebugEnabled() {
	return getLevel() <= LocationAwareLogger.DEBUG_INT
			&& delegate.isDebugEnabled();
}
 
Example 19
Source File: ProxyConnectionLogger.java    From g4proxy with Apache License 2.0 4 votes vote down vote up
protected void log(int level, String message, Throwable t) {
    if (level != LocationAwareLogger.DEBUG_INT || logger.isDebugEnabled()) {
        dispatch.doLog(level, message, null, t);
    }
}