4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
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 LogFormat public header */
26 #ifndef HH_SENF_Utils_Logger_LogFormat_
27 #define HH_SENF_Utils_Logger_LogFormat_ 1
33 //#include "LogFormat.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
45 void showTime(bool flag = true); ///< Enable or disable output of time field
46 void showStream(bool flag = true); ///< Enable or disable output of stream field
47 void showLevel(bool flag = true); ///< Enable or disable output of log level
48 void showArea(bool flag = true); ///< Enable or disable output of log area
50 void timeFormat(std::string const & format);
52 /**< The date formatting is set using the Boost.DateTime
55 target.timeFormat("%Y%m%d %H:%M:%S");
57 If the \c timeFormat is set to the empty string, the
58 time is written out as unformatted ClockService value.
60 By default, the date-time will be written in extended
62 \param[in] format Date/Time format string */
64 void tag(std::string const & tag); ///< Set tag (log line prefix)
67 std::string prefix(time_type timestamp, std::string const & stream,
68 std::string const & area, unsigned level);
69 bool isPlainFormat() const;
73 std::stringstream datestream_;
82 void quoteNonPrintable(std::string & s);
83 std::string getDefaultTag();
87 ///////////////////////////////hh.e////////////////////////////////////////
88 #include "LogFormat.cci"
89 //#include "LogFormat.ct"
90 //#include "LogFormat.cti"
98 // c-file-style: "senf"
99 // indent-tabs-mode: nil
100 // ispell-local-dictionary: "american"
101 // compile-command: "scons -u test"