4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer NETwork research (NET)
6 // Stefan Bund <g0dil@berlios.de>
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.
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.
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.
24 \brief Definitions public header */
26 #ifndef HH_Definitions_
27 #define HH_Definitions_ 1
31 //#include "Definitions.mpp"
32 #include "Definitions.ih"
33 ///////////////////////////////hh.p////////////////////////////////////////
38 ///\addtogroup logging
40 ///\name Defining logger objects
43 /** \brief Define log stream
45 Defines a new log stream named \a stream. The stream is defined as a symbol in the current
48 \a defaultLevel defines the default log level for messages posted to this stream. \a
49 runtimeLimit defines the default log limit. Messages with a level below this will not be
50 output. \a compileLimit defines the default log level limit at compile time: Messages
51 posted with a level below \a compileLimit will be discarded at compile time.
55 # define SENF_LOG_DEF_STREAM(stream, defaultLevel_, runtimeLimit_, compileLimit_) \
57 : public senf::log::detail::StreamBase, public senf::singleton<stream> \
59 typedef defaultLevel_ defaultLevel; \
60 typedef runtimeLimit_ runtimeLimit; \
61 typedef compileLimit_ compileLimit; \
62 static std::string name() { return instance().v_name(); } \
64 stream() { init(); } \
65 friend class senf::singleton<stream>; \
68 /** \brief Define log area
70 Defines a new log area named \a area. The area is defined as a symbol in the current scope.
75 # define SENF_LOG_DEF_AREA(area) SENF_LOG_DEF_AREA_I(area, ; )
77 /** \brief Define new default log area for the class
79 This command declares the containing class to be it's own default log area. It is such like a
80 combination of \ref SENF_LOG_DEF_AREA and \ref SENF_LOG_DEFAULT_AREA with a twist.
82 # define SENF_LOG_CLASS_AREA() \
83 SENF_LOG_DEF_AREA_I( \
85 std::string v_name() const \
86 { std::string s (fullName()); return std::string(s,0,s.size()-13); }); \
87 SENF_LOG_DEFAULT_AREA(SENFLogArea)
90 /** \brief Define log parameter alias
92 Defines a new parameter alias named \a alias as an alias for the parameters in \a args. The
93 alias is defined as a symbol in the current scope.
97 # define SENF_LOG_DEF_ALIAS(alias,args) \
98 struct alias : public senf::log::detail::AliasBase \
100 template <class Base> \
103 typedef typename SENF_LOG_MERGE_PARAMETERS_I(Base,args) type; \
107 /** \brief Default global log stream */
108 SENF_LOG_DEF_STREAM(Debug, MESSAGE, DISABLED, DISABLED);
110 /** \brief Default global log area */
111 SENF_LOG_DEF_AREA_I(DefaultArea,
112 std::string v_name() const { return ""; });
119 ///////////////////////////////hh.e////////////////////////////////////////
120 //#include "Definitions.cci"
121 //#include "Definitions.ct"
122 //#include "Definitions.cti"
129 // comment-column: 40
130 // c-file-style: "senf"
131 // indent-tabs-mode: nil
132 // ispell-local-dictionary: "american"
133 // compile-command: "scons -u test"