X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FIOStreamTarget.hh;h=229ab6309c4614537327adbf81aa4bb8d2880c6b;hb=bd9f9d3fd6fbcff0112a7bf48ab9284da9576b11;hp=8aa5829b2077fd25ef79cd939d8469f61b59a15d;hpb=8e3d9795b3dc412a9dcc3c807547c314d76c8504;p=senf.git diff --git a/Utils/Logger/IOStreamTarget.hh b/Utils/Logger/IOStreamTarget.hh index 8aa5829..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,38 +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 */ - - void tag(std::string const & tag); + 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, @@ -90,15 +77,6 @@ namespace log { private: std::ostream & stream_; - std::string tag_; - std::stringstream datestream_; - bool noformat_; - bool showTime_; - bool showStream_; - bool showLevel_; - bool showArea_; - - time_type timeBase_; }; }}