/** * Logs the specified message and details. * * @param message the message to log * @param from the message sender * @param to the message addressee * @param status message status * @param sender determines whether we are the origin of this message. */ public void logMessage( SIPMessage message, String from, String to, String status, boolean sender) { if (!logger.isInfoEnabled()) return; String msgHeader; if (sender) msgHeader = "JAIN-SIP sent a message from=\""; else msgHeader = "JAIN-SIP received a message from=\""; if (logger.isInfoEnabled()) logger.info(msgHeader + from + "\" to=\"" + to + "\" (status: " + status + "):\n" + message); }
/** * Log an exception. * * @param ex the exception that we are to log. */ public void logException(Throwable ex) { logger.warn("Exception in the JAIN-SIP stack: " + ex.getMessage()); if (logger.isInfoEnabled()) logger.info("JAIN-SIP exception stack trace is", ex); }
/** * Log an info message. * * @param string the message that we'd like to log. */ public void logInfo(String string) { if (logger.isInfoEnabled()) logger.info("Info from the JAIN-SIP stack: " + string); }