001: /*
002: Copyright (C) 2002-2004 MySQL AB
003:
004: This program is free software; you can redistribute it and/or modify
005: it under the terms of version 2 of the GNU General Public License as
006: published by the Free Software Foundation.
007:
008: There are special exceptions to the terms and conditions of the GPL
009: as it is applied to this software. View the full text of the
010: exception in file EXCEPTIONS-CONNECTOR-J in the directory of this
011: software distribution.
012:
013: This program is distributed in the hope that it will be useful,
014: but WITHOUT ANY WARRANTY; without even the implied warranty of
015: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: GNU General Public License for more details.
017:
018: You should have received a copy of the GNU General Public License
019: along with this program; if not, write to the Free Software
020: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
021:
022:
023:
024: */
025: package com.mysql.jdbc.log;
026:
027: /**
028: * Unified interface to logging facilities on different platforms
029: *
030: * @author Mark Matthews
031: *
032: * @version $Id: Log.java 3726 2005-05-19 15:52:24Z mmatthews $
033: */
034: public interface Log {
035: /**
036: * Is the 'debug' log level enabled?
037: *
038: * @return true if so.
039: */
040: boolean isDebugEnabled();
041:
042: /**
043: * Is the 'error' log level enabled?
044: *
045: * @return true if so.
046: */
047: boolean isErrorEnabled();
048:
049: /**
050: * Is the 'fatal' log level enabled?
051: *
052: * @return true if so.
053: */
054: boolean isFatalEnabled();
055:
056: /**
057: * Is the 'info' log level enabled?
058: *
059: * @return true if so.
060: */
061: boolean isInfoEnabled();
062:
063: /**
064: * Is the 'trace' log level enabled?
065: *
066: * @return true if so.
067: */
068: boolean isTraceEnabled();
069:
070: /**
071: * Is the 'warn' log level enabled?
072: *
073: * @return true if so.
074: */
075: boolean isWarnEnabled();
076:
077: /**
078: * Logs the given message instance using the 'debug' level
079: *
080: * @param msg
081: * the message to log
082: */
083: void logDebug(Object msg);
084:
085: /**
086: * Logs the given message and Throwable at the 'debug' level.
087: *
088: * @param msg
089: * the message to log
090: * @param thrown
091: * the throwable to log (may be null)
092: */
093: void logDebug(Object msg, Throwable thrown);
094:
095: /**
096: * Logs the given message instance using the 'error' level
097: *
098: * @param msg
099: * the message to log
100: */
101: void logError(Object msg);
102:
103: /**
104: * Logs the given message and Throwable at the 'error' level.
105: *
106: * @param msg
107: * the message to log
108: * @param thrown
109: * the throwable to log (may be null)
110: */
111: void logError(Object msg, Throwable thrown);
112:
113: /**
114: * Logs the given message instance using the 'fatal' level
115: *
116: * @param msg
117: * the message to log
118: */
119: void logFatal(Object msg);
120:
121: /**
122: * Logs the given message and Throwable at the 'fatal' level.
123: *
124: * @param msg
125: * the message to log
126: * @param thrown
127: * the throwable to log (may be null)
128: */
129: void logFatal(Object msg, Throwable thrown);
130:
131: /**
132: * Logs the given message instance using the 'info' level
133: *
134: * @param msg
135: * the message to log
136: */
137: void logInfo(Object msg);
138:
139: /**
140: * Logs the given message and Throwable at the 'info' level.
141: *
142: * @param msg
143: * the message to log
144: * @param thrown
145: * the throwable to log (may be null)
146: */
147: void logInfo(Object msg, Throwable thrown);
148:
149: /**
150: * Logs the given message instance using the 'trace' level
151: *
152: * @param msg
153: * the message to log
154: */
155: void logTrace(Object msg);
156:
157: /**
158: * Logs the given message and Throwable at the 'trace' level.
159: *
160: * @param msg
161: * the message to log
162: * @param thrown
163: * the throwable to log (may be null)
164: */
165: void logTrace(Object msg, Throwable thrown);
166:
167: /**
168: * Logs the given message instance using the 'warn' level
169: *
170: * @param msg
171: * the message to log
172: */
173: void logWarn(Object msg);
174:
175: /**
176: * Logs the given message and Throwable at the 'warn' level.
177: *
178: * @param msg
179: * the message to log
180: * @param thrown
181: * the throwable to log (may be null)
182: */
183: void logWarn(Object msg, Throwable thrown);
184: }
|