KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > logging > LoggerPlugin


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.logging;
23
24 /**
25  * Defines a "pluggable" login module. In fact, this is only used to split between
26  * log4j and /dev/null. Choice is made in org.jboss.logging.Logger
27  *
28  * @see org.jboss.logging.Logger
29  * @see org.jboss.logging.NullLoggerPlugin
30  *
31  * @author <a HREF="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
32  * @version $Revision: 2081 $
33  */

34 public interface LoggerPlugin
35 {
36    /**
37     * Initialise the logger with the given name
38     *
39     * @param name the name
40     */

41    void init(String JavaDoc name);
42
43    /**
44     * Check to see if the TRACE level is enabled for this logger.
45     *
46     * @return true if a {@link #trace(Object)} method invocation would pass
47     * the msg to the configured appenders, false otherwise.
48     */

49    boolean isTraceEnabled();
50
51    /**
52     * Issue a log msg with a level of TRACE.
53     *
54     * @param message the message
55     */

56    void trace(Object JavaDoc message);
57
58    /**
59     * Issue a log msg and throwable with a level of TRACE.
60     *
61     * @param message the message
62     * @param t the throwable
63     */

64    void trace(Object JavaDoc message, Throwable JavaDoc t);
65
66    /**
67     * Check to see if the DEBUG level is enabled for this logger.
68     *
69     * @deprecated DEBUG is for low volume logging, you don't need this
70     * @return true if a {@link #trace(Object)} method invocation would pass
71     * the msg to the configured appenders, false otherwise.
72     */

73    boolean isDebugEnabled();
74
75    /**
76     * Issue a log msg with a level of DEBUG.
77     *
78     * @param message the message
79     */

80    void debug(Object JavaDoc message);
81
82    /**
83     * Issue a log msg and throwable with a level of DEBUG.
84     *
85     * @param message the message
86     * @param t the throwable
87     */

88    void debug(Object JavaDoc message, Throwable JavaDoc t);
89
90    /**
91     * Check to see if the INFO level is enabled for this logger.
92     *
93     * @deprecated INFO is for low volume information, you don't need this
94     * @return true if a {@link #info(Object)} method invocation would pass
95     * the msg to the configured appenders, false otherwise.
96     */

97    boolean isInfoEnabled();
98
99    /**
100     * Issue a log msg with a level of INFO.
101     *
102     * @param message the message
103     */

104    void info(Object JavaDoc message);
105
106    /**
107     * Issue a log msg and throwable with a level of INFO.
108     *
109     * @param message the message
110     * @param t the throwable
111     */

112    void info(Object JavaDoc message, Throwable JavaDoc t);
113
114    /**
115     * Issue a log msg with a level of WARN.
116     *
117     * @param message the message
118     */

119    void warn(Object JavaDoc message);
120
121    /**
122     * Issue a log msg and throwable with a level of WARN.
123     *
124     * @param message the message
125     * @param t the throwable
126     */

127    void warn(Object JavaDoc message, Throwable JavaDoc t);
128
129    /**
130     * Issue a log msg with a level of ERROR.
131     *
132     * @param message the message
133     */

134    void error(Object JavaDoc message);
135
136    /**
137     * Issue a log msg and throwable with a level of ERROR.
138     *
139     * @param message the message
140     * @param t the throwable
141     */

142    void error(Object JavaDoc message, Throwable JavaDoc t);
143
144    /**
145     * Issue a log msg with a level of FATAL.
146     *
147     * @param message the message
148     */

149    void fatal(Object JavaDoc message);
150
151    /**
152     * Issue a log msg and throwable with a level of FATAL.
153     *
154     * @param message the message
155     * @param t the throwable
156     */

157    void fatal(Object JavaDoc message, Throwable JavaDoc t);
158 }
159
Popular Tags