e3bd8695e8a1a4797fbe2d473f0ef15171f1f2ef
[senf.git] / Utils / Logger / Levels.hh
1 // $Id$
2 //
3 // Copyright (C) 2007 
4 // Fraunhofer Institute for Open Communication Systems (FOKUS) 
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY 
6 //     Stefan Bund <g0dil@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief Levels public header */
25
26 #ifndef HH_Levels_
27 #define HH_Levels_ 1
28
29 // Custom includes
30
31 //#include "Levels.mpp"
32 #include "Levels.ih"
33 ///////////////////////////////hh.p////////////////////////////////////////
34
35 namespace senf {
36 namespace log {
37
38     /** \defgroup loglevels Log levels
39         
40         These are the valid log levels with some additional special values:
41
42         <dl><dt>VERBOSE</dt><dd>Really verbose log messages. Messages at this level are used for
43         internal debugging. They should be enabled only selectively within the areas currently under
44         inspection.</dd>
45
46         <dt>NOTICE</dt><dd>Arbitrary unimportant notice. Message which normally should be disabled
47         but might be informative to better understand the programs operation.</dd>
48
49         <dt>MESSAGE</dt><dd>Purely informative message which should be displayed if not explicitly
50         disabled.</dd>
51
52         <dt>IMPORTANT</dt><dd>Important information or warning which really should be read.</dd>
53
54         <dt>CRITICAL</dt><dd>Error condition which does not terminate the program completely but has
55         non-reversible adverse effects</dd>
56         
57         <dt>FATAL</dt><dd>Error condition which does terminate program execution or enforces a
58         restart or some kind of re-initialization with loss of state and context.</dd></dl>
59
60         There are also some special values which <em>must not be used as a log level</em>:
61         
62         <dl><dt>DISABLED</dt><dd>Disable all log messages.</dd> 
63
64         <dt>NONE</dt><dd>Special value which signifies inheritance of the default log
65         level.</dd></dl>
66
67         Log levels are classes, not numbers. Each log level class has a \c value member which gives
68         that levels numeric priority. The larger the number, the more important the message is.
69
70         \implementation The log levels need to be classes since areas and streams are classes: Since
71             log arguments (stream, area and level) may appear in any order and number, it is much
72             simpler to parse them if they are all of the same type.
73      */
74
75     ///\ingroup loglevels
76     ///\{
77     
78     /** \brief Log level VERBOSE
79         \see loglevels */
80     struct VERBOSE   : public detail::LevelBase { static unsigned const value = 1; };
81
82     /** \brief Log level NOTICE
83         \see loglevels */
84     struct NOTICE    : public detail::LevelBase { static unsigned const value = 2; };
85
86     /** \brief Log level MESSAGE
87         \see loglevels */
88     struct MESSAGE   : public detail::LevelBase { static unsigned const value = 3; };
89
90     /** \brief Log level IMPORTANT
91         \see loglevels */
92     struct IMPORTANT : public detail::LevelBase { static unsigned const value = 4; };
93
94     /** \brief Log level CRITICAL
95         \see loglevels */
96     struct CRITICAL  : public detail::LevelBase { static unsigned const value = 5; };
97
98     /** \brief Log level FATAL
99         \see loglevels */
100     struct FATAL     : public detail::LevelBase { static unsigned const value = 6; };
101
102     /** \brief Disable logging
103         \see loglevels */
104     struct DISABLED  : public detail::LevelBase { static unsigned const value = 7; };
105
106     /** \brief Inherit log level
107         \see loglevels */
108     struct NONE      : public detail::LevelBase { static unsigned const value = 0; };
109
110     ///\}
111
112 }}
113
114 ///////////////////////////////hh.e////////////////////////////////////////
115 //#include "Levels.cci"
116 //#include "Levels.ct"
117 //#include "Levels.cti"
118 #endif
119
120 \f
121 // Local Variables:
122 // mode: c++
123 // fill-column: 100
124 // comment-column: 40
125 // c-file-style: "senf"
126 // indent-tabs-mode: nil
127 // ispell-local-dictionary: "american"
128 // compile-command: "scons -u test"
129 // End: