001: /**
002: * Copyright (C) 2004-2007 Jive Software. All rights reserved.
003: *
004: * This software is published under the terms of the GNU Public License (GPL),
005: * a copy of which is included in this distribution.
006: */package org.jivesoftware.util;
007:
008: /**
009: * A simple logging service for components. Four log levels are provided:<ul>
010: *
011: * <li>Error -- an error occured in the component.
012: * <li>Warn -- a condition occured that an administrator should be warned about.
013: * <li>Info -- used to send information messages, such as a version or license notice.
014: * <li>Debug -- used to send debugging information. Most Log implementations will
015: * disable debug output by default.
016: * </ul>
017: *
018: * Log implementations will attempt use the native logging service of the component host
019: * server. However, this may not be possible in some cases -- for example, when using an
020: * external component that is not currently connected to the server.
021: *
022: * @author Matt Tucker
023: */
024: public interface Logger {
025:
026: /**
027: * Logs an error.
028: *
029: * @param message the error message.
030: */
031: public void error(String message);
032:
033: /**
034: * Logs an error.
035: *
036: * @param message the error message.
037: * @param throwable the Throwable that caused the error.
038: */
039: public void error(String message, Throwable throwable);
040:
041: /**
042: * Logs an error.
043: *
044: * @param throwable the Throwable that caused the error.
045: */
046: public void error(Throwable throwable);
047:
048: /**
049: * Logs a warning.
050: *
051: * @param message the warning message.
052: */
053: public void warn(String message);
054:
055: /**
056: * Logs a warning.
057: *
058: * @param message the warning message.
059: * @param throwable the Throwable that caused the error.
060: */
061: public void warn(String message, Throwable throwable);
062:
063: /**
064: * Logs a warning.
065: *
066: * @param throwable the Throwable that caused the error.
067: */
068: public void warn(Throwable throwable);
069:
070: /**
071: * Logs an info message.
072: *
073: * @param message the info message.
074: */
075: public void info(String message);
076:
077: /**
078: * Logs an info message.
079: *
080: * @param message the info message.
081: * @param throwable the Throwable that caused the info message.
082: */
083: public void info(String message, Throwable throwable);
084:
085: /**
086: * Logs an info message.
087: *
088: * @param throwable the Throwable that caused the info message.
089: */
090: public void info(Throwable throwable);
091:
092: /**
093: * Logs a debug message.
094: *
095: * @param message the debug message.
096: */
097: public void debug(String message);
098:
099: /**
100: * Logs a debug message.
101: *
102: * @param message the debug message.
103: * @param throwable the Throwable that caused the debug message.
104: */
105: public void debug(String message, Throwable throwable);
106:
107: /**
108: * Logs a debug message.
109: *
110: * @param throwable the Throwable the caused the debug message.
111: */
112: public void debug(Throwable throwable);
113:
114: }
|