KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > datashare > LoggingInterface


1 /* ----- BEGIN LICENSE BLOCK -----
2  * Version: MPL 1.1
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  * http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * The Original Code is the DataShare server.
15  *
16  * The Initial Developer of the Original Code is
17  * Ball Aerospace & Technologies Corp, Fairborn, Ohio
18  * Portions created by the Initial Developer are Copyright (C) 2001
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s): Charles Wood <cwood@ball.com>
22  *
23  * ----- END LICENSE BLOCK ----- */

24 /* RCS $Id: LoggingInterface.java,v 1.1 2002/01/29 20:55:28 lizellaman Exp $
25  * $Log: LoggingInterface.java,v $
26  * Revision 1.1 2002/01/29 20:55:28 lizellaman
27  * Added LoggingInterface, modified the PropertiesInterface implementation
28  *
29  *
30  */

31
32 package org.datashare;
33
34 import java.util.Hashtable JavaDoc;
35
36 /**
37  * this interface is to be implemented by the class that provides the extended Logging of
38  * console messages that is needed by DataShare.
39  * @date January 25, 2002
40  * @author Charles Wood
41  * @version 1.0
42  */

43 public interface LoggingInterface
44    {
45    /**
46     * if true, we will augment the ADSDebug settings and force our text to our
47     * console based on filter settings and categories selected.
48     */

49    //boolean override = false; // not implemented yet...
50

51    
52    
53    
54    // valid values for level:
55
final static int DEBUG = 1;
56    final static int WARNING = 2;
57    final static int ERROR = 3;
58    final static int FATALERROR = 4;
59    
60    final static String JavaDoc levelStrings[] =
61       { "Unkown", "Debug", "Warning", "Error", "FatalError" };
62    
63    // valid values for category:
64
final static int CLIENT = 1;
65    final static int SESSION = 2;
66    final static int DATABASE = 3;
67    final static int NETWORK = 4;
68    final static int GENERALSTATUS = 5;
69    
70    final static String JavaDoc categoryStrings[] =
71       { "Unknown", "Client", "Session", "Database", "Network", "GeneralStatus" };
72
73    /**
74     * should be used to log/capture Exceptions
75     * @param level valid values are defined in this class and are as follows:
76     * "DEBUG", "WARNING", "ERROR", "FATALERROR"
77     */

78    void logException(int level, Exception JavaDoc e);
79       
80    /**
81     * this is the method that should be used for all console messages of DataShare
82     * so that filtering at runtime may be implemented.
83     * @param level valid values are defined in this class and are as follows:
84     * "DEBUG", "WARNING", "ERROR", "FATALERROR"
85     * @param category valid values are defined in this class and are as follows:
86     * "CLIENT", "SESSION", "DATABASE", "NETWORK"
87     */

88    void debugMsg(int level, int category, String JavaDoc msg);
89    
90    
91    }
92
93
Popular Tags