4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief Levels public header */
31 #ifndef HH_SENF_Utils_Logger_Levels_
32 #define HH_SENF_Utils_Logger_Levels_ 1
36 //#include "Levels.mpp"
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
43 /** \defgroup loglevels Log levels
45 These are the valid %log levels with some additional special values:
47 <dl><dt>VERBOSE</dt><dd>Really verbose %log messages. Messages at this level are used for
48 internal debugging. They should be enabled only selectively within the areas currently under
49 inspection. The default %log stream senf::log::Debug has these messages <em>disabled</em> at
50 compile time by default. To enable them, see \ref config.</dd>
52 <dt>NOTICE</dt><dd>Arbitrary unimportant notice. Message which normally should be disabled
53 but might be informative to better understand the programs operation.</dd>
55 <dt>MESSAGE</dt><dd>Purely informative message which should be displayed if not explicitly
58 <dt>IMPORTANT</dt><dd>Important information or warning which really should be read.</dd>
60 <dt>CRITICAL</dt><dd>Error condition which does not terminate the program completely but has
61 non-reversible adverse effects</dd>
63 <dt>FATAL</dt><dd>Error condition which does terminate program execution or enforces a
64 restart or some kind of re-initialization with loss of state and context.</dd></dl>
66 There are also some special values which <em>must not be used as a %log level</em>:
68 <dl><dt>DISABLED</dt><dd>Disable all %log messages.</dd>
70 <dt>NONE</dt><dd>Special value which signifies inheritance of the default %log
73 Log levels are classes, not numbers. Each %log level class has a \c value member which gives
74 that levels numeric priority. The larger the number, the more important the message is.
76 \implementation The %log levels need to be classes since areas and streams are classes: Since
77 %log arguments (stream, area and level) may appear in any order and number, it is much
78 simpler to parse them if they are all of the same type.
83 /** \brief Log level %VERBOSE
85 struct VERBOSE : public detail::LevelBase { static unsigned const value = 1; };
87 /** \brief Log level %NOTICE
89 struct NOTICE : public detail::LevelBase { static unsigned const value = 2; };
91 /** \brief Log level %MESSAGE
93 struct MESSAGE : public detail::LevelBase { static unsigned const value = 3; };
95 /** \brief Log level %IMPORTANT
97 struct IMPORTANT : public detail::LevelBase { static unsigned const value = 4; };
99 /** \brief Log level %CRITICAL
101 struct CRITICAL : public detail::LevelBase { static unsigned const value = 5; };
103 /** \brief Log level %FATAL
105 struct FATAL : public detail::LevelBase { static unsigned const value = 6; };
107 /** \brief Disable logging
109 struct DISABLED : public detail::LevelBase { static unsigned const value = 7; };
111 /** \brief Inherit %log level
113 struct NONE : public detail::LevelBase { static unsigned const value = 0; };
117 static char const * const LEVELNAMES[8] = {
118 "NONE", "VERBOSE", "NOTICE", "MESSAGE", "IMPORTANT", "CRITICAL", "FATAL", "DISABLED" };
122 //-/////////////////////////////////////////////////////////////////////////////////////////////////
123 //#include "Levels.cci"
124 //#include "Levels.ct"
125 //#include "Levels.cti"
132 // comment-column: 40
133 // c-file-style: "senf"
134 // indent-tabs-mode: nil
135 // ispell-local-dictionary: "american"
136 // compile-command: "scons -u test"