/** * Logs the given message at INFO level * <p> * The given object is converted to a string if necessary. The INFO level should be used for informative * messages to the system operator which occur at a low rate * * @param msg the message to be logged */ public void INFO(Object msg) { if (msg == null) { return; } if (logger.isInfoEnabled()) { fixMDC(); if (msg instanceof Throwable) { logger.info(((Throwable) msg).getMessage(), (Throwable) msg); } else { logger.info(msg.toString()); } tap(msg, true, Level.INFO); } else { tap(msg, false, Level.INFO); } }
/** * Formats the given message at the INFO level using the supplied parameters. * <p> * The INFO level should be used for informative messages to the system operator which occur at a low rate * * @param msg the message containing placeholders as understood by {@link Strings#apply(String, Object...)} * @param params the parameters used to format the resulting log message */ public void INFO(String msg, Object... params) { msg = Strings.apply(msg, params); if (logger.isInfoEnabled()) { fixMDC(); logger.info(msg); tap(msg, true, Level.INFO); } else { tap(msg, false, Level.INFO); } }
/** * Formats the given message at the FINE level using the supplied parameters. * <p> * The FINE level can be used for in depth debug or trace messages used when developing a system. * Sill the rate should be kept bearable to enable this level in production systems to narrow down errors. * * @param msg the message containing placeholders as understood by {@link Strings#apply(String, Object...)} * @param params the parameters used to format the resulting log message */ public void FINE(String msg, Object... params) { msg = Strings.apply(msg, params); if (logger.isDebugEnabled()) { fixMDC(); logger.debug(msg); tap(msg, true, Level.DEBUG); } else { tap(msg, false, Level.DEBUG); } }
/** * Logs the given message at the FINE level * <p> * The given object is converted to a string if necessary. The FINE level can be used for in depth debug or trace * messages used when developing a system. Sill the rate should be kept bearable to enable this level in * production systems to narrow down errors. * * @param msg the message to be logged */ public void FINE(Object msg) { if (logger.isDebugEnabled()) { fixMDC(); if (msg instanceof Throwable) { logger.debug(((Throwable) msg).getMessage(), (Throwable) msg); } else { logger.debug(NLS.toUserString(msg)); } tap(msg, true, Level.DEBUG); } else { tap(msg, false, Level.DEBUG); } }
/** * Logs the given message at the WARN level * <p> * The given object is converted to a string if necessary. The WARN level can be used to signal unexpected * situations which do not (yet) result in an error or problem. * * @param msg the message to be logged */ public void WARN(Object msg) { fixMDC(); if (msg instanceof Throwable) { logger.warn(((Throwable) msg).getMessage(), (Throwable) msg); } else { logger.warn(NLS.toUserString(msg)); } tap(msg, true, Level.WARN); }
/** * Logs the given message at the SEVERE or ERROR level * <p> * The given object is converted to a string if necessary. The ERROR level can be used to signal problems or error * which occurred in the system. It is recommended to handle exceptions using {@link Exceptions} - which will * eventually also call this method, but provides sophisticated error handling. * * @param msg the message to be logged */ public void SEVERE(Object msg) { fixMDC(); if (msg instanceof Throwable) { logger.error(((Throwable) msg).getMessage(), (Throwable) msg); } else { logger.error(NLS.toUserString(msg)); } tap(msg, true, Level.ERROR); }
/** * Formats the given message at the WARN level using the supplied parameters. * <p> * The WARN level can be used to signal unexpected situations which do not (yet) result in an error or problem. * * @param msg the message containing placeholders as understood by {@link Strings#apply(String, Object...)} * @param params the parameters used to format the resulting log message */ public void WARN(String msg, Object... params) { msg = Strings.apply(msg, params); fixMDC(); logger.warn(msg); tap(msg, true, Level.WARN); }