X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FFileTarget.hh;h=5a80a7a0c84081cb382d43fbb9b4c57299d23c0e;hb=82e8df5de8b11448423388632e8602ad97bc7885;hp=45f11fd1e0c458bceeacaefb0bcf323d035cd9a4;hpb=6a0836b7f462d3d77b79b35638cdbf4c9d4202fc;p=senf.git diff --git a/Utils/Logger/FileTarget.hh b/Utils/Logger/FileTarget.hh index 45f11fd..5a80a7a 100644 --- a/Utils/Logger/FileTarget.hh +++ b/Utils/Logger/FileTarget.hh @@ -23,11 +23,12 @@ /** \file \brief FileTarget public header */ -#ifndef HH_FileTarget_ -#define HH_FileTarget_ 1 +#ifndef HH_SENF_Utils_Logger_FileTarget_ +#define HH_SENF_Utils_Logger_FileTarget_ 1 // Custom includes #include +#include #include #include "IOStreamTarget.hh" @@ -35,6 +36,9 @@ ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { + + namespace console { class DirectoryNode; } + namespace log { /** \brief Log target writing to a %log file. @@ -65,16 +69,26 @@ namespace log { ///\name Structors and default members ///@{ - explicit FileTarget(std::string file); ///< Construct FileTarget writing to \a file + explicit FileTarget(std::string const & filename, std::string const & nodename = ""); + ///< Construct FileTarget writing to \a file ///@} /////////////////////////////////////////////////////////////////////////// void reopen(); ///< Reopen %log after log-file rotation - void reopen(std::string file); ///< Reopen %log under a new name + void reopen(std::string const & file); ///< Reopen %log under a new name + + std::string const & filename() const; ///< Return current log file name private: std::string file_; + + struct RegisterConsole { + RegisterConsole(); + static boost::shared_ptr create( + std::string const & filename, std::string const & nodename); + static RegisterConsole instance; + }; }; }}