Source Code Cross Referenced for LogkitLogger.java in  » Inversion-of-Control » DNA » org » codehaus » dna » 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 » Inversion of Control » DNA » org.codehaus.dna.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) The DNA Group. All rights reserved.
003:         *
004:         * This software is published under the terms of the DNA
005:         * Software License version 1.1, a copy of which has been included
006:         * with this distribution in the LICENSE.txt file.
007:         */
008:        package org.codehaus.dna.impl;
009:
010:        import org.codehaus.dna.Logger;
011:
012:        /**
013:         * Logging facade implmentation for Apache Logkit project.
014:         * The following lists the mapping between DNA log levels
015:         * and LogKit log levels.
016:         *
017:         * <ul>
018:         *   <li>trace ==&gt; debug</li>
019:         *   <li>debug ==&gt; debug</li>
020:         *   <li>info ==&gt; info</li>
021:         *   <li>warn ==&gt; warn</li>
022:         *   <li>error ==&gt; error</li>
023:         * </ul>
024:         *
025:         * @version $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
026:         */
027:        public class LogkitLogger implements  Logger {
028:            /**
029:             * The Logkit logger.
030:             */
031:            private final org.apache.log.Logger m_logger;
032:
033:            /**
034:             * Create an instance of LogKit logger facade.
035:             *
036:             * @param logger the logkit logger
037:             */
038:            public LogkitLogger(final org.apache.log.Logger logger) {
039:                if (null == logger) {
040:                    throw new NullPointerException("logger");
041:                }
042:                m_logger = logger;
043:            }
044:
045:            /**
046:             * Log a trace message.
047:             *
048:             * @param message the message
049:             */
050:            public void trace(final String message) {
051:                m_logger.debug(message);
052:            }
053:
054:            /**
055:             * Log a trace message with an associated throwable.
056:             *
057:             * @param message the message
058:             * @param throwable the throwable
059:             */
060:            public void trace(final String message, final Throwable throwable) {
061:                m_logger.debug(message, throwable);
062:            }
063:
064:            /**
065:             * Return true if a trace message will be logged.
066:             *
067:             * @return true if message will be logged
068:             */
069:            public boolean isTraceEnabled() {
070:                return m_logger.isDebugEnabled();
071:            }
072:
073:            /**
074:             * Log a debug message.
075:             *
076:             * @param message the message
077:             */
078:            public void debug(final String message) {
079:                m_logger.debug(message);
080:            }
081:
082:            /**
083:             * Log a debug message with an associated throwable.
084:             *
085:             * @param message the message
086:             * @param throwable the throwable
087:             */
088:            public void debug(final String message, final Throwable throwable) {
089:                m_logger.debug(message, throwable);
090:            }
091:
092:            /**
093:             * Return true if a debug message will be logged.
094:             *
095:             * @return true if message will be logged
096:             */
097:            public boolean isDebugEnabled() {
098:                return m_logger.isDebugEnabled();
099:            }
100:
101:            /**
102:             * Log a info message.
103:             *
104:             * @param message the message
105:             */
106:            public void info(final String message) {
107:                m_logger.info(message);
108:            }
109:
110:            /**
111:             * Log a info message with an associated throwable.
112:             *
113:             * @param message the message
114:             * @param throwable the throwable
115:             */
116:            public void info(final String message, final Throwable throwable) {
117:                m_logger.info(message, throwable);
118:            }
119:
120:            /**
121:             * Return true if an info message will be logged.
122:             *
123:             * @return true if message will be logged
124:             */
125:            public boolean isInfoEnabled() {
126:                return m_logger.isInfoEnabled();
127:            }
128:
129:            /**
130:             * Log a warn message.
131:             *
132:             * @param message the message
133:             */
134:            public void warn(final String message) {
135:                m_logger.warn(message);
136:            }
137:
138:            /**
139:             * Log a warn message with an associated throwable.
140:             *
141:             * @param message the message
142:             * @param throwable the throwable
143:             */
144:            public void warn(final String message, final Throwable throwable) {
145:                m_logger.warn(message, throwable);
146:            }
147:
148:            /**
149:             * Return true if a warn message will be logged.
150:             *
151:             * @return true if message will be logged
152:             */
153:            public boolean isWarnEnabled() {
154:                return m_logger.isWarnEnabled();
155:            }
156:
157:            /**
158:             * Log a error message.
159:             *
160:             * @param message the message
161:             */
162:            public void error(final String message) {
163:                m_logger.error(message);
164:            }
165:
166:            /**
167:             * Log a error message with an associated throwable.
168:             *
169:             * @param message the message
170:             * @param throwable the throwable
171:             */
172:            public void error(final String message, final Throwable throwable) {
173:                m_logger.error(message, throwable);
174:            }
175:
176:            /**
177:             * Return true if a error message will be logged.
178:             *
179:             * @return true if message will be logged
180:             */
181:            public boolean isErrorEnabled() {
182:                return m_logger.isErrorEnabled();
183:            }
184:
185:            /**
186:             * Get the child logger with specified name.
187:             *
188:             * @param name the name of child logger
189:             * @return the child logger
190:             */
191:            public Logger getChildLogger(final String name) {
192:                return new LogkitLogger(m_logger.getChildLogger(name));
193:            }
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.