/** * Log a message object at the WARN level. * * @param msg * - the message object to be logged */ public void warn(String msg) { log(Log.WARN, msg, null); }
@Override public boolean isInfoEnabled() { return isEnabled(Logger.Level.INFO); }
private void log(int priority, String message, Throwable throwable) { if (isLoggable(priority)) { logInternal(priority, message, throwable); } }
/** * Log a message at level DEBUG according to the specified format and argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for level DEBUG. * </p> * * @param format * the format string * @param arg * the argument */ public void debug(String format, Object arg) { formatAndLog(Log.DEBUG, format, arg); }
@Override public Logger getLogger(String name) { return new AndroidLoggerAdapter(LoggerManager.getLogger(name)); }
/** * Is this logger instance enabled for the INFO level? * * @return True if this Logger is enabled for the INFO level, false otherwise. */ public boolean isInfoEnabled() { return isLoggable(Log.INFO); }
/** * Log a message at level INFO according to the specified format and argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the INFO level. * </p> * * @param format * the format string * @param arg * the argument */ public void info(String format, Object arg) { formatAndLog(Log.INFO, format, arg); }
/** * Return an appropriate {@link AndroidLoggerAdapter} instance by name. */ public Logger getLogger(String name) { String tag = loggerNameToTag(name); Logger logger = loggerMap.get(tag); if (logger == null) { Logger newInstance = new AndroidLoggerAdapter(tag); Logger oldInstance = loggerMap.putIfAbsent(tag, newInstance); logger = oldInstance == null ? newInstance : oldInstance; } return logger; }
/** * Is this logger instance enabled for the WARN level? * * @return True if this Logger is enabled for the WARN level, false * otherwise. */ public boolean isWarnEnabled() { return isLoggable(Log.WARN); }
/** * Log an exception (throwable) at the WARN level with an accompanying * message. * * @param msg * the message accompanying the exception * @param t * the exception (throwable) to log */ public void warn(String msg, Throwable t) { log(Log.WARN, msg, t); }
/** * Log a message at level WARN according to the specified format and * arguments. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the WARN level. * </p> * * @param format * the format string * @param argArray * an array of arguments */ public void warn(String format, Object... argArray) { formatAndLog(Log.WARN, format, argArray); }
private void formatAndLog(int priority, String format, Object... argArray) { if (isLoggable(priority)) { FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray); logInternal(priority, ft.getMessage(), ft.getThrowable()); } }
/** * Is this logger instance enabled for the DEBUG level? * * @return True if this Logger is enabled for level DEBUG, false otherwise. */ public boolean isDebugEnabled() { return isLoggable(Log.DEBUG); }
@Override public boolean isTraceEnabled() { return isEnabled(Logger.Level.VERBOSE); }
@Override public void trace(String format, Object arg1, Object arg2) { log(Logger.Level.VERBOSE, format, arg1, arg2); }
/** * Log a message at level VERBOSE according to the specified format and * arguments. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the VERBOSE level. * </p> * * @param format * the format string * @param argArray * an array of arguments */ public void trace(String format, Object... argArray) { formatAndLog(Log.VERBOSE, format, argArray); }
/** * Is this logger instance enabled for the VERBOSE level? * * @return True if this Logger is enabled for level VERBOSE, false otherwise. */ public boolean isTraceEnabled() { return isLoggable(Log.VERBOSE); }
@Override public boolean isErrorEnabled() { return isEnabled(Logger.Level.ERROR); }
@Override public void info(String format, Object... arguments) { log(Logger.Level.INFO, format, arguments); }
/** * Log a message at level DEBUG according to the specified format and * arguments. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the DEBUG level. * </p> * * @param format * the format string * @param argArray * an array of arguments */ public void debug(String format, Object... argArray) { formatAndLog(Log.DEBUG, format, argArray); }