Source Code Cross Referenced for LoggableObject.java in  » Database-Client » iSQL-Viewer » org » isqlviewer » util » 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 » Database Client » iSQL Viewer » org.isqlviewer.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the Mozilla Public License
003:         * Version 1.1 (the "License"); you may not use this file except in
004:         * compliance with the License. You may obtain a copy of the License at
005:         * http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
009:         * License for the specific language governing rights and limitations
010:         * under the License.
011:         * 
012:         * The Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
013:         *
014:         * The Initial Developer of the Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
015:         * Portions created by Mark A. Kobold are Copyright (C) 2000-2007. All Rights Reserved.
016:         *
017:         * Contributor(s): 
018:         *  Mark A. Kobold [mkobold <at> isqlviewer <dot> com].
019:         *  
020:         * If you didn't download this code from the following link, you should check
021:         * if you aren't using an obsolete version: http://www.isqlviewer.com
022:         */
023:        package org.isqlviewer.util;
024:
025:        import org.apache.log4j.Logger;
026:
027:        /**
028:         * Utility base class for providing logging support as part of the class itself.
029:         * <p>
030:         * Point of this is simple; and that is to make logging information via log4j easier
031:         * 
032:         * @author Mark A. Kobold &lt;mkobold at isqlviewer dot com&gt;
033:         * @version 1.0
034:         */
035:        public abstract class LoggableObject {
036:
037:            private Logger logger = Logger.getLogger(getClass());
038:
039:            /**
040:             * Logs informational error and supplementary message.
041:             * <p>
042:             * if informational messages are enabled the message and exception will be logged to designated destination.
043:             * 
044:             * @param message informational message to log.
045:             * @param error exception associated with the message.
046:             */
047:            protected final void info(Object message, Throwable error) {
048:
049:                if (logger.isInfoEnabled()) {
050:                    logger.info(message, error);
051:                }
052:            }
053:
054:            /**
055:             * Logs an informational message.
056:             * <p>
057:             * if informational loggins is enabled the message will be logged to designated destination.
058:             * 
059:             * @param message informational message to log.
060:             */
061:            protected final void info(Object message) {
062:
063:                if (logger.isInfoEnabled()) {
064:                    logger.info(message);
065:                }
066:            }
067:
068:            /**
069:             * Logs debugging messages and supplementary exception.
070:             * <p>
071:             * if debug messages are enabled the message and exception will be logged to designated destination.
072:             * 
073:             * @param message debug message to log.
074:             * @param error exception associated with the message.
075:             */
076:            protected final void debug(Object message, Throwable error) {
077:
078:                if (logger.isDebugEnabled()) {
079:                    logger.debug(message, error);
080:                }
081:            }
082:
083:            /**
084:             * Logs message for debugging purposes.
085:             * <p>
086:             * if debugging is enabled the message will be logged to designated destination.
087:             * 
088:             * @param message debug information to log.
089:             */
090:            protected final void debug(Object message) {
091:
092:                if (logger.isDebugEnabled()) {
093:                    logger.debug(message);
094:                }
095:            }
096:
097:            /**
098:             * Logs error messages and supplementary exception.
099:             * <p>
100:             * if error messages are enabled the message and exception will be logged to designated destination.
101:             * 
102:             * @param message error message to log.
103:             * @param error exception associated with the message.
104:             */
105:            protected final void error(Object message, Throwable error) {
106:
107:                logger.error(message, error);
108:            }
109:
110:            /**
111:             * Logs an error message.
112:             * <p>
113:             * if error logging is enabled the message will be logged to designated destination.
114:             * 
115:             * @param message error message to log.
116:             */
117:            protected final void error(Object message) {
118:
119:                logger.error(message);
120:            }
121:
122:            /**
123:             * Logs warning messages and supplementary exception.
124:             * <p>
125:             * 
126:             * @param message warning message to log.
127:             * @param error exception associated with the message.
128:             */
129:            protected final void warn(Object message, Throwable error) {
130:
131:                logger.warn(message, error);
132:            }
133:
134:            /**
135:             * Logs warning messages.
136:             * <p>
137:             * 
138:             * @param message warning information to log.
139:             */
140:            protected final void warn(Object message) {
141:
142:                logger.warn(message);
143:            }
144:
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.