KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > slf4j > helpers > MarkerIgnoringBase


1 /*
2  * Copyright (c) 2004-2007 QOS.ch
3  * All rights reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */

24
25 package org.slf4j.helpers;
26
27 import org.slf4j.Logger;
28 import org.slf4j.Marker;
29
30
31 /**
32  * This class serves as base for adapters or native implementations of logging systems
33  * lacking Marker support. In this implementation, methods taking marker data
34  * simply invoke the corresponding method without the Marker argument, discarding
35  * any marker data passed as argument.
36  *
37  * @author Ceki Gulcu
38  */

39 public abstract class MarkerIgnoringBase implements Logger {
40
41   public boolean isTraceEnabled(Marker marker) {
42     return isTraceEnabled();
43   }
44   
45   public void trace(Marker marker, String JavaDoc msg) {
46     debug(msg);
47   }
48
49   public void trace(Marker marker, String JavaDoc format, Object JavaDoc arg) {
50     debug(format, arg);
51   }
52
53   public void trace(Marker marker, String JavaDoc format, Object JavaDoc arg1, Object JavaDoc arg2) {
54     debug(format, arg1, arg2);
55   }
56
57   public void trace(Marker marker, String JavaDoc format, Object JavaDoc[] argArray) {
58     debug(format, argArray);
59   }
60
61   public void trace(Marker marker, String JavaDoc msg, Throwable JavaDoc t) {
62     debug(msg, t);
63   }
64   
65   public boolean isDebugEnabled(Marker marker) {
66     return isDebugEnabled();
67   }
68
69   public void debug(Marker marker, String JavaDoc msg) {
70     debug(msg);
71   }
72
73   public void debug(Marker marker, String JavaDoc format, Object JavaDoc arg) {
74     debug(format, arg);
75   }
76
77   public void debug(Marker marker, String JavaDoc format, Object JavaDoc arg1, Object JavaDoc arg2) {
78     debug(format, arg1, arg2);
79   }
80
81   public void debug(Marker marker, String JavaDoc format, Object JavaDoc[] argArray) {
82     debug(format, argArray);
83   }
84
85   public void debug(Marker marker, String JavaDoc msg, Throwable JavaDoc t) {
86     debug(msg, t);
87   }
88
89   public boolean isInfoEnabled(Marker marker) {
90     return isInfoEnabled();
91   }
92
93   public void info(Marker marker, String JavaDoc msg) {
94     info(msg);
95   }
96
97   public void info(Marker marker, String JavaDoc format, Object JavaDoc arg) {
98     info(format, arg);
99   }
100
101   public void info(Marker marker, String JavaDoc format, Object JavaDoc arg1, Object JavaDoc arg2) {
102     info(format, arg1, arg2);
103   }
104
105   public void info(Marker marker, String JavaDoc format, Object JavaDoc[] argArray) {
106     info(format, argArray);
107   }
108
109   public void info(Marker marker, String JavaDoc msg, Throwable JavaDoc t) {
110     info(msg, t);
111   }
112
113   public boolean isWarnEnabled(Marker marker) {
114     return isWarnEnabled();
115   }
116
117   public void warn(Marker marker, String JavaDoc msg) {
118     warn(msg);
119   }
120
121   public void warn(Marker marker, String JavaDoc format, Object JavaDoc arg) {
122     warn(format, arg);
123   }
124
125   public void warn(Marker marker, String JavaDoc format, Object JavaDoc arg1, Object JavaDoc arg2) {
126     warn(format, arg1, arg2);
127   }
128
129   public void warn(Marker marker, String JavaDoc format, Object JavaDoc[] argArray) {
130     warn(format, argArray);
131   }
132
133   public void warn(Marker marker, String JavaDoc msg, Throwable JavaDoc t) {
134     warn(msg, t);
135   }
136
137  
138   public boolean isErrorEnabled(Marker marker) {
139     return isErrorEnabled();
140   }
141
142   public void error(Marker marker, String JavaDoc msg) {
143     error(msg);
144   }
145
146   public void error(Marker marker, String JavaDoc format, Object JavaDoc arg) {
147     error(format, arg);
148   }
149
150   public void error(Marker marker, String JavaDoc format, Object JavaDoc arg1, Object JavaDoc arg2) {
151     error(format, arg1, arg2);
152   }
153
154   public void error(Marker marker, String JavaDoc format, Object JavaDoc[] argArray) {
155     error(format, argArray);
156   }
157
158   public void error(Marker marker, String JavaDoc msg, Throwable JavaDoc t) {
159     error(msg, t);
160   }
161
162   public String JavaDoc toString() {
163       return this.getClass().getName()+"("+getName()+")";
164   }
165 }
166
Popular Tags