X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FIOStreamTarget.hh;h=229ab6309c4614537327adbf81aa4bb8d2880c6b;hb=81f84badf27b66dbadec9890646ca1193e998505;hp=aee7e3f3cd303a3b2c874894c68b08d95b8555ab;hpb=adcd3672d48f44103f2b4abc6417acf5d0107978;p=senf.git diff --git a/Utils/Logger/IOStreamTarget.hh b/Utils/Logger/IOStreamTarget.hh index aee7e3f..229ab63 100644 --- a/Utils/Logger/IOStreamTarget.hh +++ b/Utils/Logger/IOStreamTarget.hh @@ -30,6 +30,7 @@ #include #include #include "Target.hh" +#include "LogFormat.hh" //#include "IOStreamTarget.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -49,36 +50,24 @@ namespace log { \ingroup targets */ class IOStreamTarget - : public Target + : public Target, private detail::LogFormat { public: /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ - explicit IOStreamTarget(std::ostream & os); + IOStreamTarget(std::string const & name, std::ostream & os); ///@} /////////////////////////////////////////////////////////////////////////// - void showTime(bool flag = true); ///< Enable or disable output of time field - void showStream(bool flag = true); ///< Enable or disable output of stream field - void showLevel(bool flag = true); ///< Enable or disable output of log level - void showArea(bool flag = true); ///< Enable or disable output of log area - - void timeFormat(std::string const & format); - ///< Set time format - /**< The date formatting is set using the Boost.DateTime - date_facet, e.g. - \code - target.timeFormat("%Y%m%d %H:%M:%S"); - \endcode - If the \c timeFormat is set to the empty string, the - time is written out as unformatted ClockService value. - - By default, the date-time will be written in extended - ISO format. - \param[in] format Date/Time format string */ + using detail::LogFormat::showTime; + using detail::LogFormat::showStream; + using detail::LogFormat::showLevel; + using detail::LogFormat::showArea; + using detail::LogFormat::timeFormat; + using detail::LogFormat::tag; protected: void v_write(time_type timestamp, std::string const & stream, @@ -88,13 +77,6 @@ namespace log { private: std::ostream & stream_; - std::stringstream datestream_; - bool noformat_; - bool showTime_; - bool showStream_; - bool showLevel_; - bool showArea_; - }; }}