X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.hh;h=e371443f2eb48f692ebfc15b3d80d9a337fbf13f;hb=8da6e83b001f0ae8383af7eb4b3e3a079178a777;hp=502bae810eb68fa6076b41b51181bc20935a3971;hpb=054f407988120bf96b648ad61068073e22db4f00;p=senf.git diff --git a/Utils/Logger/Target.hh b/Utils/Logger/Target.hh index 502bae8..e371443 100644 --- a/Utils/Logger/Target.hh +++ b/Utils/Logger/Target.hh @@ -36,6 +36,7 @@ #include "StreamRegistry.hh" #include "../Exception.hh" #include "TimeSource.hh" +#include "../Console/LazyDirectory.hh" //#include "Target.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -55,6 +56,7 @@ namespace log { namespace detail { class TargetRegistry; } namespace detail { class AreaBase; } + namespace detail { struct LogParameters; } /** \brief Logging target base class @@ -160,7 +162,7 @@ namespace log { # endif RoutingEntry(); - bool operator==(RoutingEntry const & other); + bool operator==(RoutingEntry const & other) const; private: RoutingEntry(detail::StreamBase const * stream, detail::AreaBase const * area, @@ -185,7 +187,7 @@ namespace log { ///\name Structors and default members ///@{ - Target(); + explicit Target(std::string const & name); virtual ~Target(); ///@} @@ -338,7 +340,10 @@ namespace log { size_type size() const; ///< Number of routing table entries bool empty() const; ///< \c true, if routing table empty, \c false otherwise - void clear(); ///< Clear routing table + void flush(); ///< Clear routing table + + protected: + senf::console::ScopedDirectory<> & consoleDir(); ///< Get console/config directory private: void route(detail::StreamBase const * stream, detail::AreaBase const * area, @@ -351,6 +356,10 @@ namespace log { void write(time_type timestamp, detail::StreamBase const & stream, detail::AreaBase const & area, unsigned level, std::string const & message); + void consoleList(std::ostream & os); + void consoleRoute(int index, detail::LogParameters const & pm, action_t action); + void consoleUnroute(detail::LogParameters const & pm, action_t action); + # ifdef DOXYGEN protected: # endif @@ -382,6 +391,8 @@ namespace log { RIB rib_; + console::LazyDirectory consoleDir_; + friend class detail::AreaBase; friend class detail::TargetRegistry; };