21d517660779ab64f91e102de29218c7394767eb
[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     ///\{
76     
77     /** \brief Log level VERBOSE
78         \see loglevels */
79     struct VERBOSE   : public detail::LevelBase { static unsigned const value = 1; };
80
81     /** \brief Log level NOTICE
82         \see loglevels */
83     struct NOTICE    : public detail::LevelBase { static unsigned const value = 2; };
84
85     /** \brief Log level MESSAGE
86         \see loglevels */
87     struct MESSAGE   : public detail::LevelBase { static unsigned const value = 3; };
88
89     /** \brief Log level IMPORTANT
90         \see loglevels */
91     struct IMPORTANT : public detail::LevelBase { static unsigned const value = 4; };
92
93     /** \brief Log level CRITICAL
94         \see loglevels */
95     struct CRITICAL  : public detail::LevelBase { static unsigned const value = 5; };
96
97     /** \brief Log level FATAL
98         \see loglevels */
99     struct FATAL     : public detail::LevelBase { static unsigned const value = 6; };
100
101     /** \brief Disable logging
102         \see loglevels */
103     struct DISABLED  : public detail::LevelBase { static unsigned const value = 7; };
104
105     /** \brief Inherit log level
106         \see loglevels */
107     struct NONE      : public detail::LevelBase { static unsigned const value = 0; };
108
109     ///\}
110
111 }}
112
113 ///////////////////////////////hh.e////////////////////////////////////////
114 //#include "Levels.cci"
115 //#include "Levels.ct"
116 //#include "Levels.cti"
117 #endif
118
119 \f
120 // Local Variables:
121 // mode: c++
122 // fill-column: 100
123 // comment-column: 40
124 // c-file-style: "senf"
125 // indent-tabs-mode: nil
126 // ispell-local-dictionary: "american"
127 // compile-command: "scons -u test"
128 // End: