/** * PUBLIC: * <p> * Check if a message of the given level would actually be logged. * It is used when session is not available. * </p><p> * * @return true if the given message level will be logged * </p><p> * @param level the log request level * </p> */ public boolean shouldLog(int level) { return shouldLog(level, null); }
/** * INTERNAL: * <p> * Log a message with one parameter that needs to be translated. * </p><p> * * @param level the log request level value * </p><p> * @param message the string message * </p><p> * @param param a parameter of the message * </p> */ public void log(int level, String message, Object param) { if (!shouldLog(level)) { return; } log(level, message, new Object[] { param }); }
/** * PUBLIC: * <p> * Log a message that does not need to be translated. This method is intended for * external use when logging messages are wanted within the TopLink output. * </p><p> * * @param level the log request level value * </p><p> * @param message the string message * </p> */ public void log(int level, String message) { if (!shouldLog(level)) { return; } //Bug#4566524 Pass in false for external use log(level, message, (Object[])null, false); }
/** * INTERNAL: * <p> * Log a message with two parameters that needs to be translated. * </p><p> * * @param level the log request level value * </p><p> * @param message the string message * </p><p> * @param param1 a parameter of the message * </p><p> * @param param2 second parameter of the message * </p> */ public void log(int level, String message, Object param1, Object param2) { if (!shouldLog(level)) { return; } log(level, message, new Object[] { param1, param2 }); }
/** * INTERNAL: * <p> * Log a message with three parameters that needs to be translated. * </p><p> * * @param level the log request level value * </p><p> * @param message the string message * </p><p> * @param param1 a parameter of the message * </p><p> * @param param2 second parameter of the message * </p><p> * @param param3 third parameter of the message * </p> */ public void log(int level, String message, Object param1, Object param2, Object param3) { if (!shouldLog(level)) { return; } log(level, message, new Object[] { param1, param2, param3 }); }
/** * PUBLIC: * <p> * Log a throwable with level. * </p><p> * * @param level the log request level value * </p><p> * @param throwable a Throwable * </p> */ public void logThrowable(int level, Throwable throwable) { // Must not create the log if not logging as is a performance issue. if (shouldLog(level)) { log(new SessionLogEntry(null, level, null, throwable)); } }
/** * INTERNAL: * <p> * Log a message. shouldTranslate determines if the message needs to be translated. * </p><p> * * @param level the log request level * </p><p> * @param message the string message * </p><p> * @param params array of parameters to the message * </p><p> * @param shouldTranslate true if the message needs to be translated * </p> */ public void log(int level, String message, Object[] params, boolean shouldTranslate) { if (!shouldLog(level)) { return; } log(new SessionLogEntry(level, null, message, params, null, shouldTranslate)); }
/** * PUBLIC: * <p> * Log a throwable at FINER level. * </p><p> * * @param throwable a Throwable * </p> */ public void throwing(Throwable throwable) { if (shouldLog(FINER)) { SessionLogEntry entry = new SessionLogEntry(null, throwable); entry.setLevel(FINER); log(entry); } }