KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > portalImpl > services > log > StandardOutLogger


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 /*
17
18  */

19
20 package org.apache.pluto.portalImpl.services.log;
21
22 import org.apache.pluto.services.log.Logger;
23
24 /** An incredible simple Logger implementation which
25  * simply directs messages to StandardOut. This Logger
26  * is only used in cases, such as in the Deployer, when
27  * no services are registered with the ServiceManager.
28  */

29 public class StandardOutLogger implements Logger {
30
31     public StandardOutLogger() {
32     }
33
34     public boolean isDebugEnabled() {
35         return true;
36     }
37
38     public boolean isInfoEnabled() {
39         return true;
40     }
41
42     public boolean isWarnEnabled() {
43         return true;
44     }
45
46     public boolean isErrorEnabled() {
47         return true;
48     }
49
50     public void debug(String JavaDoc aMessage) {
51         System.out.println(aMessage);
52     }
53
54     public void debug(String JavaDoc aMessage, Throwable JavaDoc aThrowable) {
55         System.out.println(aMessage);
56         aThrowable.printStackTrace();
57     }
58
59     public void info(String JavaDoc aMessage) {
60         System.out.println(aMessage);
61     }
62
63     public void warn(String JavaDoc aMessage) {
64         System.out.println(aMessage);
65     }
66
67     public void error(String JavaDoc aMessage) {
68         System.out.println(aMessage);
69     }
70
71     public void error(String JavaDoc aMessage, Throwable JavaDoc aThrowable) {
72         System.out.println(aMessage);
73         aThrowable.printStackTrace();
74     }
75
76     public void error(Throwable JavaDoc aThrowable) {
77         aThrowable.printStackTrace();
78     }
79
80 }
81
Popular Tags