List of utility methods to do slf4j Logger
boolean | isSlf4jPresent() is Slfj Present return isClassPresent("org.slf4j.Logger"); |
void | log(Logger logger, int logLevel, String value) Log given value in specified log level using provided logger instance. switch (logLevel) { case 1: logTrace(logger, value); break; case 2: logDebug(logger, value); break; case 3: ... |
void | log(Logger logger, Throwable t) log if (logger.isDebugEnabled()) { logger.debug(t.getMessage(), t); } else { logger.info(t.getMessage()); |
void | log(String format, Object... arguments) Log a message. if (null != logger) { logger.info(format, arguments); } else { System.out.println(MessageFormatter.arrayFormat(format, arguments).getMessage()); |
void | log(String message) log log(Level.INFO, message); |
String | logAndIdError(Logger log, String errorMessage) log And Id Error log.error(errorMessage);
return errorMessage;
|
void | logArgs(final Logger logger, final Object[] args) log Args final String orderedBlend = args[0].toString(); logger.debug("Ordered blend: {}.", orderedBlend); if (args.length == 2) { final String orderedFlavor = args[1].toString(); logger.debug("Ordered flavor: {}.", orderedFlavor); |
void | logBind(Logger log, int index, Object value) log Bind if (log.isDebugEnabled()) { StringBuffer msg = new StringBuffer("binding "); appendBoundValue(value, msg); msg.append(" to parameter: ").append(index); log.debug(msg.toString()); |
void | logBytes(byte[] data, int length, String prefix, Logger logger) Logs sent and received bytes for debugging if (logger.isTraceEnabled()) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; i++) { byte b = data[i]; String byteString = Integer.toHexString(b & 0x000000FF); byteString = byteString.length() == 1 ? "0" + byteString : byteString; sb.append(" ").append(byteString); logger.trace(COMMUNICATION, prefix + ": " + sb.toString()); |
void | logDebug(Logger logger, String mensagem, Object... params) Verifica estado de logger e efetua log de nivel debug. if (logger.isDebugEnabled()) {
logger.debug(mensagem, params);
|