KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mckoi > debug > DebugLogger


1 /**
2  * com.mckoi.debug.DebugLogger 28 Mar 2002
3  *
4  * Mckoi SQL Database ( http://www.mckoi.com/database )
5  * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * 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  */

24
25 package com.mckoi.debug;
26
27 /**
28  * An interface for logging errors, warnings, messages, and exceptions in the
29  * Mckoi system. The implementation of where the log is written (to the
30  * console, file, window, etc) is implementation defined.
31  *
32  * @author Tobias Downer
33  */

34
35 public interface DebugLogger extends Lvl {
36
37   /**
38    * Queries the current debug level. Returns true if the debug listener is
39    * interested in debug information of this given level. This can be used to
40    * speed up certain complex debug displaying operations where the debug
41    * listener isn't interested in the information be presented.
42    */

43   boolean isInterestedIn(int level);
44
45   /**
46    * This writes the given debugging string. It filters out any messages that
47    * are below the 'debug_level' variable. The 'object' variable specifies
48    * the object that made the call. 'level' must be between 0 and 255. A
49    * message of 'level' 255 will always print.
50    */

51   void write(int level, Object JavaDoc ob, String JavaDoc message);
52
53   void write(int level, Class JavaDoc cla, String JavaDoc message);
54
55   void write(int level, String JavaDoc class_string, String JavaDoc message);
56
57   /**
58    * This writes the given Exception. Exceptions are always output to the log
59    * stream.
60    */

61   void writeException(Throwable JavaDoc e);
62
63   /**
64    * This writes the given Exception but gives it a 'debug_level'. This is
65    * so we can write out a warning exception.
66    */

67   void writeException(int level, Throwable JavaDoc e);
68
69 }
70
Popular Tags