001: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/framework/log/ILogger.java $
002: /*---------------- FILE HEADER ------------------------------------------
003:
004: This file is part of deegree.
005: Copyright (C) 2001-2008 by:
006: EXSE, Department of Geography, University of Bonn
007: http://www.giub.uni-bonn.de/deegree/
008: lat/lon GmbH
009: http://www.lat-lon.de
010:
011: This library is free software; you can redistribute it and/or
012: modify it under the terms of the GNU Lesser General Public
013: License as published by the Free Software Foundation; either
014: version 2.1 of the License, or (at your option) any later version.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: Contact:
026:
027: Andreas Poth
028: lat/lon GmbH
029: Aennchenstr. 19
030: 53115 Bonn
031: Germany
032: E-Mail: poth@lat-lon.de
033:
034: Prof. Dr. Klaus Greve
035: Department of Geography
036: University of Bonn
037: Meckenheimer Allee 166
038: 53115 Bonn
039: Germany
040: E-Mail: greve@giub.uni-bonn.de
041:
042:
043: ---------------------------------------------------------------------------*/
044: package org.deegree.framework.log;
045:
046: import java.io.File;
047: import java.util.Properties;
048:
049: import org.deegree.framework.xml.XMLFragment;
050:
051: /**
052: * This interface specifies the log worker services.
053: *
054: * @author <a href="mailto:tfr@users.sourceforge.net">Torsten Friebe</a>
055: * @author <a href="mailto:schmitz@lat-lon.de">Andreas Schmitz</a>
056: * @author <a href="mailto:schneider@lat-lon.de">Markus Schneider</a>
057: * @author last edited by: $Author: apoth $
058: *
059: * @version $Revision: 9347 $, $Date: 2007-12-27 08:58:50 -0800 (Thu, 27 Dec 2007) $
060: */
061: public interface ILogger {
062:
063: /** Debug log level */
064: int LOG_DEBUG = 0;
065:
066: /** Info log level */
067: int LOG_INFO = 1;
068:
069: /** Warning log level */
070: int LOG_WARNING = 2;
071:
072: /** Fatal error log level */
073: int LOG_ERROR = 3;
074:
075: /**
076: *
077: * @param props
078: */
079: void init(Properties props);
080:
081: /**
082: *
083: * @param name
084: */
085: void bindClass(String name);
086:
087: /**
088: *
089: * @param name
090: */
091: void bindClass(Class name);
092:
093: /**
094: *
095: * @param message
096: */
097: void logDebug(String message);
098:
099: /**
100: * Logs the given text to the specified file if log level is set to <code>LOG_DEBUG</code>.
101: *
102: * @param file
103: * file to log to
104: * @param content
105: * text to be logged
106: */
107: void logDebugFile(File file, String content);
108:
109: /**
110: * Logs the given text to a temporary file (created from specified prefix and suffix) if log level is set to
111: * <code>LOG_DEBUG</code>.
112: *
113: * @see File#createTempFile(String, String)
114: * @param filePrefix
115: * prefix for the temp file name
116: * @param fileSuffix
117: * suffix for the temp file name, can be null (then ".tmp" is used)
118: * @param content
119: * text to be logged
120: */
121: void logDebugFile(String filePrefix, String fileSuffix,
122: String content);
123:
124: /**
125: * Logs the given {@link XMLFragment} to a temporary file (created from specified prefix and suffix ".xml") if log
126: * level is set to <code>LOG_DEBUG</code>.
127: *
128: * @param filePrefix
129: * prefix for the temp file name
130: * @param fragment
131: * XMLFragment to be logged (will be pretty-printed)
132: */
133: void logDebugXMLFile(String filePrefix, XMLFragment fragment);
134:
135: /**
136: * Logs the given binary data to the specified file if log level is set to <code>LOG_DEBUG</code>.
137: *
138: * @param file
139: * file to log to
140: * @param data
141: * binary data to be logged
142: */
143: void logDebugBinaryFile(File file, byte[] data);
144:
145: /**
146: * Logs the given binary data to a temporary file (created from specified prefix and suffix) if log level is set to
147: * <code>LOG_DEBUG</code>.
148: *
149: * @see File#createTempFile(String, String)
150: * @param filePrefix
151: * prefix for the temp file name
152: * @param fileSuffix
153: * suffix for the temp file name, can be null (then ".tmp" is used)
154: * @param data
155: * binary data to be logged
156: */
157: void logDebugBinaryFile(String filePrefix, String fileSuffix,
158: byte[] data);
159:
160: /**
161: *
162: * @param message
163: */
164: void logInfo(String message);
165:
166: /**
167: *
168: * @param message
169: */
170: void logWarning(String message);
171:
172: /**
173: * Log error message.
174: *
175: * @param message
176: * the log message
177: */
178: void logError(String message);
179:
180: /**
181: *
182: * @param message
183: * @param e
184: */
185: void logDebug(String message, Throwable e);
186:
187: /**
188: *
189: * @param message
190: * @param e
191: */
192: void logInfo(String message, Throwable e);
193:
194: /**
195: *
196: * @param message
197: * @param e
198: */
199: void logWarning(String message, Throwable e);
200:
201: /**
202: * Log error with exception
203: *
204: * @param message
205: * the log message
206: * @param e
207: * the exception to be logged
208: */
209: void logError(String message, Throwable e);
210:
211: /**
212: *
213: * @param message
214: * @param tracableObject
215: */
216: void logDebug(String message, Object tracableObject);
217:
218: /**
219: *
220: * @param message
221: * @param tracableObjects
222: */
223: void logDebug(String message, Object... tracableObject);
224:
225: /**
226: *
227: * @param message
228: * @param tracableObject
229: */
230: void logInfo(String message, Object tracableObject);
231:
232: /**
233: *
234: * @param message
235: * @param tracableObjects
236: */
237: void logInfo(String message, Object... tracableObject);
238:
239: /**
240: *
241: * @param priority
242: * @param message
243: * @param ex
244: */
245: void log(int priority, String message, Throwable ex);
246:
247: /**
248: *
249: * @param priority
250: * @param message
251: * @param source
252: * @param ex
253: */
254: void log(int priority, String message, Object source, Throwable ex);
255:
256: /**
257: * sets the debug level
258: *
259: * @param level
260: *
261: */
262: void setLevel(int level);
263:
264: /**
265: * @return the debug level
266: *
267: */
268: int getLevel();
269:
270: /**
271: * Debugging log is enabled.
272: *
273: * @return <code>true</code> if the log level is DEBUG, otherwise <code>false</code>
274: */
275: boolean isDebug();
276: }
|