Source Code Cross Referenced for OzoneDebugLevel.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » 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 DBMS » Ozone 1.1 » org.ozoneDB.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // You can redistribute this software and/or modify it under the terms of
002:        // the Ozone Library License version 1 published by ozone-db.org.
003:        //
004:        // Copyright (C) Nordic Wave Inc, All rights reserved
005:        // $Id: OzoneDebugLevel.java,v 1.1 2002/05/17 08:55:47 per_nyfelt Exp $
006:
007:        package org.ozoneDB.util;
008:
009:        import org.apache.log4j.Level;
010:
011:        /*
012:         * Adding three finer debug levels to the Log4J Level class
013:         *
014:         */
015:
016:        /**
017:         public final static int DEBUG2_INT = 9000;
018:         public final static int DEBUG3_INT = 8000;
019:
020:
021:         The <code>DEBUG</code> priority designates fine-grained
022:         informational events that are most useful to debug an
023:         application.
024:         final static public Priority DEBUG2_INT = new Level(DEBUG2_INT, "DEBUG2_INT", 7);
025:         */
026:        public class OzoneDebugLevel extends Level {
027:
028:            static public final int DEBUG1_INT = Level.DEBUG_INT - 100;
029:            static public final int DEBUG2_INT = Level.DEBUG_INT - 200;
030:            static public final int DEBUG3_INT = Level.DEBUG_INT - 300;
031:
032:            /* Log4j does not set these as constants in Priority, so the following ones
033:             * matches those used internally by Priority */
034:
035:            /** The least verbose level */
036:            public static final String FATAL_STR = "FATAL";
037:            /** One step finer (more verbose) than fatal */
038:            public static final String ERROR_STR = "ERROR";
039:            /** One step finer (more verbose) than error */
040:            public static final String WARN_STR = "WARN";
041:            /** One step finer (more verbose) than warn */
042:            public static final String INFO_STR = "INFO";
043:            /** One step finer (more verbose) than info */
044:            public static final String DEBUG_STR = "DEBUG";
045:
046:            /** One step finer (more verbose) than debug */
047:            public static final String DEBUG1_STR = "DEBUG1";
048:            /** One step finer (more verbose) than debug1 */
049:            public static final String DEBUG2_STR = "DEBUG2";
050:            /** One step finer (more verbose) than debug2 */
051:            public static final String DEBUG3_STR = "DEBUG3";
052:
053:            public static final OzoneDebugLevel DEBUG1 = new OzoneDebugLevel(
054:                    DEBUG1_INT, DEBUG1_STR, 7);
055:            public static final OzoneDebugLevel DEBUG2 = new OzoneDebugLevel(
056:                    DEBUG2_INT, DEBUG2_STR, 7);
057:            public static final OzoneDebugLevel DEBUG3 = new OzoneDebugLevel(
058:                    DEBUG3_INT, DEBUG3_STR, 7);
059:
060:            protected OzoneDebugLevel(int level, String strLevel,
061:                    int syslogEquiv) {
062:                super (level, strLevel, syslogEquiv);
063:            }
064:
065:            /**
066:             Convert the string passed as argument to a level. If the
067:             conversion fails, then this method returns {@link #DEBUG1}.
068:             */
069:            public static Level toLevel(String sArg) {
070:                return (Level) toLevel(sArg, OzoneDebugLevel.DEBUG1);
071:            }
072:
073:            public static Level toLevel(String sArg, Level defaultValue) {
074:
075:                if (sArg == null) {
076:                    return defaultValue;
077:                }
078:                String stringVal = sArg.toUpperCase();
079:
080:                if (stringVal.equals(DEBUG1_STR)) {
081:                    return OzoneDebugLevel.DEBUG1;
082:                } else if (stringVal.equals(DEBUG2_STR)) {
083:                    return OzoneDebugLevel.DEBUG2;
084:                } else if (stringVal.equals(DEBUG3_STR)) {
085:                    return OzoneDebugLevel.DEBUG3;
086:                }
087:
088:                return Level.toLevel(sArg, (Level) defaultValue);
089:            }
090:
091:            public static Level toLevel(int i) throws IllegalArgumentException {
092:                switch (i) {
093:                case DEBUG1_INT:
094:                    return OzoneDebugLevel.DEBUG1;
095:                case DEBUG2_INT:
096:                    return OzoneDebugLevel.DEBUG2;
097:                case DEBUG3_INT:
098:                    return OzoneDebugLevel.DEBUG3;
099:                }
100:                return Level.toLevel(i);
101:            }
102:
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.