Source Code Cross Referenced for SLF4JLog.java in  » Development » SLF4J » org » apache » commons » logging » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » SLF4J » org.apache.commons.logging.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // TOTO
002:
003:        package org.apache.commons.logging.impl;
004:
005:        import java.io.Serializable;
006:
007:        import org.apache.commons.logging.Log;
008:        import org.slf4j.Logger;
009:
010:        /**
011:         * Implementation of {@link Log org.apache.commons.logging.Log} interface which 
012:         * delegates all processing to a wrapped {@link Logger org.slf4j.Logger} instance.
013:         * 
014:         * <p>JCL's FATAL and TRACE levels are mapped to ERROR and DEBUG respectively. All 
015:         * other levels map one to one.
016:         * 
017:         * @author Ceki G&uuml;lc&uuml;
018:         */
019:        public class SLF4JLog implements  Log, Serializable {
020:
021:            private static final long serialVersionUID = 680728617011167209L;
022:
023:            // in both Log4jLogger and Jdk14Logger classes in the original JCL, the 
024:            // logger instance is transient
025:            private transient Logger logger;
026:
027:            SLF4JLog(Logger logger) {
028:                this .logger = logger;
029:            }
030:
031:            /**
032:             * Directly delegates to the wrapped <code>org.slf4j.Logger</code> instance.
033:             */
034:            public boolean isDebugEnabled() {
035:                return logger.isDebugEnabled();
036:            }
037:
038:            /**
039:             * Directly delegates to the wrapped <code>org.slf4j.Logger</code> instance.
040:             */
041:            public boolean isErrorEnabled() {
042:                return logger.isErrorEnabled();
043:            }
044:
045:            /**
046:             * Delegates to the <code>isErrorEnabled<code> method of the wrapped 
047:             * <code>org.slf4j.Logger</code> instance.
048:             */
049:            public boolean isFatalEnabled() {
050:                return logger.isErrorEnabled();
051:            }
052:
053:            /**
054:             * Directly delegates to the wrapped <code>org.slf4j.Logger</code> instance.
055:             */
056:            public boolean isInfoEnabled() {
057:                return logger.isInfoEnabled();
058:            }
059:
060:            /**
061:             * Delegates to the <code>isDebugEnabled<code> method of the wrapped 
062:             * <code>org.slf4j.Logger</code> instance.
063:             */
064:            public boolean isTraceEnabled() {
065:                return logger.isTraceEnabled();
066:            }
067:
068:            /**
069:             * Directly delegates to the wrapped <code>org.slf4j.Logger</code> instance.
070:             */
071:            public boolean isWarnEnabled() {
072:                return logger.isWarnEnabled();
073:            }
074:
075:            /**
076:             * Converts the input parameter to String and then delegates to 
077:             * the debug method of the wrapped <code>org.slf4j.Logger</code> instance.
078:             * 
079:             * @param message the message to log. Converted to {@link String}  
080:             */
081:            public void trace(Object message) {
082:                logger.trace(String.valueOf(message));
083:            }
084:
085:            /**
086:             * Converts the first input parameter to String and then delegates to 
087:             * the debug method of the wrapped <code>org.slf4j.Logger</code> instance.
088:             * 
089:             * @param message the message to log. Converted to {@link String}  
090:             * @param t the exception to log
091:             */
092:            public void trace(Object message, Throwable t) {
093:                logger.trace(String.valueOf(message), t);
094:            }
095:
096:            /**
097:             * Converts the input parameter to String and then delegates to the wrapped 
098:             * <code>org.slf4j.Logger</code> instance.
099:             * 
100:             * @param message the message to log. Converted to {@link String} 
101:             */
102:            public void debug(Object message) {
103:                logger.debug(String.valueOf(message));
104:            }
105:
106:            /**
107:             * Converts the first input parameter to String and then delegates to 
108:             * the wrapped <code>org.slf4j.Logger</code> instance.
109:             * 
110:             * @param message the message to log. Converted to {@link String}  
111:             * @param t the exception to log
112:             */
113:            public void debug(Object message, Throwable t) {
114:                logger.debug(String.valueOf(message), t);
115:            }
116:
117:            /**
118:             * Converts the input parameter to String and then delegates to the wrapped 
119:             * <code>org.slf4j.Logger</code> instance.
120:             * 
121:             * @param message the message to log. Converted to {@link String} 
122:             */
123:            public void info(Object message) {
124:                logger.info(String.valueOf(message));
125:            }
126:
127:            /**
128:             * Converts the first input parameter to String and then delegates to 
129:             * the wrapped <code>org.slf4j.Logger</code> instance.
130:             * 
131:             * @param message the message to log. Converted to {@link String}  
132:             * @param t the exception to log
133:             */
134:            public void info(Object message, Throwable t) {
135:                logger.info(String.valueOf(message), t);
136:            }
137:
138:            /**
139:             * Converts the input parameter to String and then delegates to the wrapped 
140:             * <code>org.slf4j.Logger</code> instance.
141:             * 
142:             * @param message the message to log. Converted to {@link String}  
143:             */
144:            public void warn(Object message) {
145:                logger.warn(String.valueOf(message));
146:            }
147:
148:            /**
149:             * Converts the first input parameter to String and then delegates to 
150:             * the wrapped <code>org.slf4j.Logger</code> instance.
151:             * 
152:             * @param message the message to log. Converted to {@link String}  
153:             * @param t the exception to log
154:             */
155:            public void warn(Object message, Throwable t) {
156:                logger.warn(String.valueOf(message), t);
157:            }
158:
159:            /**
160:             * Converts the input parameter to String and then delegates to the wrapped 
161:             * <code>org.slf4j.Logger</code> instance.
162:             * 
163:             * @param message the message to log. Converted to {@link String}  
164:             */
165:            public void error(Object message) {
166:                logger.error(String.valueOf(message));
167:            }
168:
169:            /**
170:             * Converts the first input parameter to String and then delegates to 
171:             * the wrapped <code>org.slf4j.Logger</code> instance.
172:             * 
173:             * @param message the message to log. Converted to {@link String}  
174:             * @param t the exception to log
175:             */
176:            public void error(Object message, Throwable t) {
177:                logger.error(String.valueOf(message), t);
178:            }
179:
180:            /**
181:             * Converts the input parameter to String and then delegates to 
182:             * the error method of the wrapped <code>org.slf4j.Logger</code> instance.
183:             * 
184:             * @param message the message to log. Converted to {@link String}  
185:             */
186:            public void fatal(Object message) {
187:                logger.error(String.valueOf(message));
188:            }
189:
190:            /**
191:             * Converts the first input parameter to String and then delegates to 
192:             * the error method of the wrapped <code>org.slf4j.Logger</code> instance.
193:             * 
194:             * @param message the message to log. Converted to {@link String}  
195:             * @param t the exception to log
196:             */
197:            public void fatal(Object message, Throwable t) {
198:                logger.error(String.valueOf(message), t);
199:            }
200:
201:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.