View Javadoc
1 /* ====================================================================
2 * License:
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 *
16 * 3. The end-user documentation included with the redistribution,
17 * if any, must include the following acknowledgment:
18 * "This product includes software developed by
19 * Robert Half International (http://www.rhi.com/)."
20 * Alternately, this acknowledgment may appear in the software itself,
21 * if and wherever such third-party acknowledgments normally appear.
22 *
23 * 4. The names "Parc", "RHI", and "Robert Half International" must
24 * not be used to endorse or promote products derived from this
25 * software without prior written permission. For written
26 * permission, please contact pete.mckinstry@rhi.com.
27 *
28 * 5. Products derived from this software may not be called "PARC",
29 * nor may "PARC" appear in their name, without prior written
30 * permission of Robert Half International.
31 *
32 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
33 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
36 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
39 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
41 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
42 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * SUCH DAMAGE.
44 * ====================================================================
45 *
46 */
47 package com.rhi.architecture.logging;
48
49 import java.util.Properties;
50
51 import com.rhi.architecture.resource.InitializationException;
52
53 /***
54 * This class exists so that if the Log initialization fails,
55 * there is some way to write messages about what happened.
56 *
57 * @author Pete McKinstry
58 * @version 1.0
59 */
60 public class DefaultLogger extends Logger {
61
62 /***
63 * Constructor for DefaultLogger.
64 */
65 public DefaultLogger() {
66 super();
67 }
68
69 /***
70 * init()
71 * @param p
72 * @throws InitializationException
73 * @see com.rhi.architecture.resource.Resource#init(java.util.Properties)
74 */
75 public void init(Properties p) throws InitializationException {
76 // no op
77 }
78
79 /***
80 * @see com.rhi.architecture.resource.Resource#close()
81 */
82 public void close() {
83 // no op
84 }
85
86 /***
87 * @see com.rhi.architecture.logging.Logger#fatal(String)
88 * @param message
89 */
90 public void fatal(String message) {
91 System.err.println(message);
92 }
93
94 /***
95 * @see com.rhi.architecture.logging.Logger#fatal(String, Exception)
96 * @param message
97 * @param t
98 */
99 public void fatal(String message, Throwable t) {
100 System.err.println(message);
101 t.printStackTrace(System.err);
102 }
103
104 /***
105 * @see com.rhi.architecture.logging.Logger#error(String)
106 * @param message
107 */
108 public void error(String message) {
109 System.err.println(message);
110 }
111
112 /***
113 * @see com.rhi.architecture.logging.Logger#error(String, Exception)
114 * @param message
115 * @param t
116 */
117 public void error(String message, Throwable t) {
118 System.err.println(message);
119 t.printStackTrace(System.err);
120 }
121
122 /***
123 * @see com.rhi.architecture.logging.Logger#warning(String)
124 * @param message
125 */
126 public void warning(String message) {
127 System.err.println(message);
128 }
129
130 /***
131 * @see com.rhi.architecture.logging.Logger#isWarningEnabled()
132 * @return boolean
133 */
134 public boolean isWarningEnabled() {
135 return true;
136 }
137
138 /***
139 * @see com.rhi.architecture.logging.Logger#info(String)
140 * @param message
141 */
142 public void info(String message) {
143 System.err.println(message);
144 }
145
146 /***
147 * @see com.rhi.architecture.logging.Logger#isInfoEnabled()
148 * @return boolean
149 */
150 public boolean isInfoEnabled() {
151 return true;
152 }
153
154 /***
155 * @see com.rhi.architecture.logging.Logger#debug(String)
156 * @param message
157 */
158 public void debug(String message) {
159 System.err.println(message);
160 }
161
162 /***
163 * @see com.rhi.architecture.logging.Logger#isDebugEnabled()
164 * @return boolean
165 */
166 public boolean isDebugEnabled() {
167 return true;
168 }
169
170 /***
171 * @see com.rhi.architecture.logging.Logger#trace(String)
172 * @param message
173 */
174 public void trace(String message) {
175 System.err.println(message);
176 }
177
178 /***
179 * @see com.rhi.architecture.logging.Logger#isTraceEnabled()
180 * @return boolean
181 */
182 public boolean isTraceEnabled() {
183 return true;
184 }
185
186 }
This page was automatically generated by Maven