KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > uml > transformation > log > LogConsole


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library 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 library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Pierre Carpentier.
23 Contributor(s): Philippe Merle.
24
25 ---------------------------------------------------------------------
26 $Id: LogConsole.java,v 1.1 2004/05/26 11:25:35 carpentier Exp $
27 ====================================================================*/

28
29 package org.objectweb.openccm.uml.transformation.log;
30
31 import org.apache.commons.logging.Log;
32
33 /**
34  * This class logs a message to the application console
35  * (of OpenCCM Application - CommandLine framework).
36  */

37 public class LogConsole implements Log {
38     
39     private String JavaDoc name;
40     
41     /**
42      * Constructor.
43      */

44     public LogConsole(String JavaDoc name) {
45         this.name = name;
46     }
47     
48     /* (non-Javadoc)
49      * @see org.apache.commons.logging.Log#debug(java.lang.Object, java.lang.Throwable)
50      */

51     public void debug(Object JavaDoc message, Throwable JavaDoc throwable) {
52         ConsoleSingleton.getConsole().message((String JavaDoc)message + " : " + throwable.toString());
53
54     }
55     
56     /* (non-Javadoc)
57      * @see org.apache.commons.logging.Log#debug(java.lang.Object)
58      */

59     public void debug(Object JavaDoc message) {
60         ConsoleSingleton.getConsole().message((String JavaDoc)message);
61     }
62     
63     /* (non-Javadoc)
64      * @see org.apache.commons.logging.Log#error(java.lang.Object, java.lang.Throwable)
65      */

66     public void error(Object JavaDoc message, Throwable JavaDoc throwable) {
67         ConsoleSingleton.getConsole().error((String JavaDoc)message + " : " + throwable.toString());
68     }
69     
70     /* (non-Javadoc)
71      * @see org.apache.commons.logging.Log#error(java.lang.Object)
72      */

73     public void error(Object JavaDoc message) {
74         ConsoleSingleton.getConsole().error((String JavaDoc)message);
75     }
76     
77     /* (non-Javadoc)
78      * @see org.apache.commons.logging.Log#fatal(java.lang.Object, java.lang.Throwable)
79      */

80     public void fatal(Object JavaDoc message, Throwable JavaDoc throwable) {
81         ConsoleSingleton.getConsole().message((String JavaDoc)message + " : " + throwable.toString());
82     }
83     
84     /* (non-Javadoc)
85      * @see org.apache.commons.logging.Log#fatal(java.lang.Object)
86      */

87     public void fatal(Object JavaDoc message) {
88         ConsoleSingleton.getConsole().message((String JavaDoc)message);
89     }
90     
91     /* (non-Javadoc)
92      * @see org.apache.commons.logging.Log#info(java.lang.Object, java.lang.Throwable)
93      */

94     public void info(Object JavaDoc message, Throwable JavaDoc throwable) {
95         ConsoleSingleton.getConsole().message((String JavaDoc)message + " : " + throwable.toString());
96     }
97     
98     /* (non-Javadoc)
99      * @see org.apache.commons.logging.Log#info(java.lang.Object)
100      */

101     public void info(Object JavaDoc message) {
102         ConsoleSingleton.getConsole().message((String JavaDoc)message);
103     }
104     
105     /* (non-Javadoc)
106      * @see org.apache.commons.logging.Log#trace(java.lang.Object, java.lang.Throwable)
107      */

108     public void trace(Object JavaDoc message, Throwable JavaDoc throwable) {
109         ConsoleSingleton.getConsole().message((String JavaDoc)message + " : " + throwable.toString());
110     }
111     
112     /* (non-Javadoc)
113      * @see org.apache.commons.logging.Log#trace(java.lang.Object)
114      */

115     public void trace(Object JavaDoc message) {
116         ConsoleSingleton.getConsole().message((String JavaDoc)message);
117     }
118     
119     /* (non-Javadoc)
120      * @see org.apache.commons.logging.Log#warn(java.lang.Object, java.lang.Throwable)
121      */

122     public void warn(Object JavaDoc message, Throwable JavaDoc throwable) {
123         ConsoleSingleton.getConsole().message((String JavaDoc)message + " : " + throwable.toString());
124     }
125     
126     /* (non-Javadoc)
127      * @see org.apache.commons.logging.Log#warn(java.lang.Object)
128      */

129     public void warn(Object JavaDoc message) {
130         ConsoleSingleton.getConsole().message((String JavaDoc)message);
131     }
132     
133     
134     /* (non-Javadoc)
135      * @see org.apache.commons.logging.Log#isDebugEnabled()
136      */

137     public boolean isDebugEnabled() {
138         return false;
139     }
140     
141     /* (non-Javadoc)
142      * @see org.apache.commons.logging.Log#isErrorEnabled()
143      */

144     public boolean isErrorEnabled() {
145         return false;
146     }
147     
148     /* (non-Javadoc)
149      * @see org.apache.commons.logging.Log#isFatalEnabled()
150      */

151     public boolean isFatalEnabled() {
152         return true;
153     }
154     
155     /* (non-Javadoc)
156      * @see org.apache.commons.logging.Log#isInfoEnabled()
157      */

158     public boolean isInfoEnabled() {
159         return false;
160     }
161     
162     /* (non-Javadoc)
163      * @see org.apache.commons.logging.Log#isTraceEnabled()
164      */

165     public boolean isTraceEnabled() {
166         return false;
167     }
168     
169     /* (non-Javadoc)
170      * @see org.apache.commons.logging.Log#isWarnEnabled()
171      */

172     public boolean isWarnEnabled() {
173         return false;
174     }
175     
176 }
Popular Tags