001: /**
002: * Copyright (C) 2001-2003 France Telecom R&D
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */package org.objectweb.util.monolog.api;
018:
019: /**
020: * <P>This class predefines a set of levels. Indeed during the instrumentation,
021: * developers must write calls to log an event with a specific level. One of
022: * the goals of Monolog is to be independent of the logging implementation.
023: * To respect this goal, predefined variables or constants are needed. This
024: * class contains only static but not final variables to represent these
025: * predefined levels.</P>
026: *
027: * <P>To respect the flyweight pattern chosen in monolog specification, for each
028: * predefined level, a Level variable and an integer variable are declared.
029: * Their values are not defined, in order to leave it to the implementation to
030: * set them. </P>
031: *
032: * <P>This class defines five basic levels. But it is possible to a MonoLog user to
033: * define additional levels. Monolog allows this type of extension with some
034: * constraints or advices:
035: * <UL>
036: * <LI>If levels are not ordered, the additional levels must be defined by an
037: * implementation of the Level interface.</LI>
038: * <LI>If levels are ordered, all additional level must have an integer value
039: * between the FATAL level and the DEBUG level.</LI>
040: * <LI>If levels are ordered, it is possible to define a level with relative
041: * integer value with an existent level
042: * (MyLevel.FINE = BasicLevel.DEBUG + 2). This possibility imposes that
043: * all MonoLog implementations define a set of sparse integer values for
044: * the levels.</LI>
045: * </UL></P>
046: */
047: public class BasicLevel {
048:
049: /**
050: * In general, FATAL messages should describe events that are of
051: * considerable importance and which will prevent continuation of the
052: * program execution. They should be intelligible to end users and to
053: * system administrators
054: */
055: public static int FATAL;
056: /**
057: * In general, FATAL messages should describe events that are of
058: * considerable importance and which will prevent continuation of the
059: * program execution. They should be intelligible to end users and to
060: * system administrators
061: */
062: public static Level LEVEL_FATAL;
063:
064: /**
065: *The ERROR level designates error events that might still allow the
066: * application to continue running.
067: */
068: public static int ERROR;
069: /**
070: *The ERROR level designates error events that might still allow the
071: * application to continue running.
072: */
073: public static Level LEVEL_ERROR;
074:
075: /**
076: * In general, WARN messages should describe events that will be of
077: * interest to end users or system managers, or which indicate potential
078: * problems.
079: */
080: public static int WARN;
081: /**
082: * In general, WARN messages should describe events that will be of
083: * interest to end users or system managers, or which indicate potential
084: * problems.
085: */
086: public static Level LEVEL_WARN;
087:
088: /**
089: * The INFO level designates informational messages that highlight the
090: * progress of the application at a coarse-grained level.
091: */
092: public static int INFO;
093: /**
094: * The INFO level designates informational messages that highlight the
095: * progress of the application at a coarse-grained level.
096: */
097: public static Level LEVEL_INFO;
098:
099: /**
100: * DEBUG messages might include things like minor (recoverable) failures.
101: * Logging calls for entering, returning, or throwing an exception can be
102: * traced at this level.
103: */
104: public static int DEBUG;
105: /**
106: * DEBUG messages might include things like minor (recoverable) failures.
107: * Logging calls for entering, returning, or throwing an exception can be
108: * traced at this level.
109: */
110: public static Level LEVEL_DEBUG;
111:
112: /**
113: * This special level indicates that the level is inherited from its
114: * ancestors.
115: */
116: public static int INHERIT;
117: /**
118: * This special level indicates that the level is inherited from its
119: * ancestors.
120: */
121: public static Level LEVEL_INHERIT;
122:
123: }
|