01: /**
02: * com.mckoi.debug.DebugLogger 28 Mar 2002
03: *
04: * Mckoi SQL Database ( http://www.mckoi.com/database )
05: * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License
09: * Version 2 as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License Version 2 for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * Version 2 along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: * Change Log:
21: *
22: *
23: */package com.mckoi.debug;
24:
25: /**
26: * An interface for logging errors, warnings, messages, and exceptions in the
27: * Mckoi system. The implementation of where the log is written (to the
28: * console, file, window, etc) is implementation defined.
29: *
30: * @author Tobias Downer
31: */
32:
33: public interface DebugLogger extends Lvl {
34:
35: /**
36: * Queries the current debug level. Returns true if the debug listener is
37: * interested in debug information of this given level. This can be used to
38: * speed up certain complex debug displaying operations where the debug
39: * listener isn't interested in the information be presented.
40: */
41: boolean isInterestedIn(int level);
42:
43: /**
44: * This writes the given debugging string. It filters out any messages that
45: * are below the 'debug_level' variable. The 'object' variable specifies
46: * the object that made the call. 'level' must be between 0 and 255. A
47: * message of 'level' 255 will always print.
48: */
49: void write(int level, Object ob, String message);
50:
51: void write(int level, Class cla, String message);
52:
53: void write(int level, String class_string, String message);
54:
55: /**
56: * This writes the given Exception. Exceptions are always output to the log
57: * stream.
58: */
59: void writeException(Throwable e);
60:
61: /**
62: * This writes the given Exception but gives it a 'debug_level'. This is
63: * so we can write out a warning exception.
64: */
65: void writeException(int level, Throwable e);
66:
67: }
|