2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shale.remoting.logger;
19  
20  /***
21   * <p>Adapter to logging systems that intends to make Commons Logging
22   * optional on deployments running on JDK 1.4 or later.</p>
23   */
24  public interface Logger {
25      
26  
27      // ------------------------------------------------------ Condition Checking
28  
29  
30      /***
31       * <p>Is trace level debugging enabled on the specified logger?</p>
32       *
33       * @param name Name of the logger to check
34       */
35      public boolean isTraceEnabled(String name);
36  
37  
38      /***
39       * <p>Is debug level debugging enabled on the specified logger?</p>
40       *
41       * @param name Name of the logger to check
42       */
43      public boolean isDebugEnabled(String name);
44  
45  
46      /***
47       * <p>Is info level debugging enabled on the specified logger?</p>
48       *
49       * @param name Name of the logger to check
50       */
51      public boolean isInfoEnabled(String name);
52  
53  
54      /***
55       * <p>Is warning level debugging enabled on the specified logger?</p>
56       *
57       * @param name Name of the logger to check
58       */
59      public boolean isWarnEnabled(String name);
60  
61  
62      /***
63       * <p>Is error level debugging enabled on the specified logger?</p>
64       *
65       * @param name Name of the logger to check
66       */
67      public boolean isErrorEnabled(String name);
68  
69  
70      /***
71       * <p>Is fatal level debugging enabled on the specified logger?</p>
72       *
73       * @param name Name of the logger to check
74       */
75      public boolean isFatalEnabled(String name);
76  
77  
78      // ------------------------------------------------------------- Log Methods
79  
80  
81      /***
82       * <p>Log a message at trace severity.</p>
83       *
84       * @param name Name of the logger to use
85       * @param message Text message to record (treated as a message format if
86       *  the <code>params</code> argument is not null)
87       * @param exception Exception to report, or <code>null</code> for none
88       * @param params Message4 format replacement parameters, or
89       *  <code>null</code> for none
90       */
91      public void trace(String name, String message,
92                        Throwable exception, Object[] params);
93  
94  
95      /***
96       * <p>Log a message at debug severity.</p>
97       *
98       * @param name Name of the logger to use
99       * @param message Text message to record (treated as a message format if
100      *  the <code>params</code> argument is not null)
101      * @param exception Exception to report, or <code>null</code> for none
102      * @param params Message4 format replacement parameters, or
103      *  <code>null</code> for none
104      */
105     public void debug(String name, String message,
106                       Throwable exception, Object[] params);
107 
108 
109     /***
110      * <p>Log a message at info severity.</p>
111      *
112      * @param name Name of the logger to use
113      * @param message Text message to record (treated as a message format if
114      *  the <code>params</code> argument is not null)
115      * @param exception Exception to report, or <code>null</code> for none
116      * @param params Message4 format replacement parameters, or
117      *  <code>null</code> for none
118      */
119     public void info(String name, String message,
120                      Throwable exception, Object[] params);
121 
122 
123     /***
124      * <p>Log a message at warning severity.</p>
125      *
126      * @param name Name of the logger to use
127      * @param message Text message to record (treated as a message format if
128      *  the <code>params</code> argument is not null)
129      * @param exception Exception to report, or <code>null</code> for none
130      * @param params Message4 format replacement parameters, or
131      *  <code>null</code> for none
132      */
133     public void warn(String name, String message,
134                      Throwable exception, Object[] params);
135 
136 
137     /***
138      * <p>Log a message at error severity.</p>
139      *
140      * @param name Name of the logger to use
141      * @param message Text message to record (treated as a message format if
142      *  the <code>params</code> argument is not null)
143      * @param exception Exception to report, or <code>null</code> for none
144      * @param params Message4 format replacement parameters, or
145      *  <code>null</code> for none
146      */
147     public void error(String name, String message,
148                       Throwable exception, Object[] params);
149 
150 
151     /***
152      * <p>Log a message at fatal severity.</p>
153      *
154      * @param name Name of the logger to use
155      * @param message Text message to record (treated as a message format if
156      *  the <code>params</code> argument is not null)
157      * @param exception Exception to report, or <code>null</code> for none
158      * @param params Message4 format replacement parameters, or
159      *  <code>null</code> for none
160      */
161     public void fatal(String name, String message,
162                       Throwable exception, Object[] params);
163 
164 
165 }