X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FLogger%2FTarget.cti;h=0f7e287ff931018c53e0a975ead3e4337104bdd7;hb=82ad2ed94c12c3e53097fef92978de8c28239fab;hp=ea7f5e28637f225c1655d11c6decfff8ffdce36c;hpb=ae06fe86f16fdabb7ffb219d255444d2eb4f4f79;p=senf.git diff --git a/Utils/Logger/Target.cti b/Utils/Logger/Target.cti index ea7f5e2..0f7e287 100644 --- a/Utils/Logger/Target.cti +++ b/Utils/Logger/Target.cti @@ -23,7 +23,7 @@ /** \file \brief Target inline template implementation */ -//#include "Target.ih" +#include "Target.ih" // Custom includes #include "Levels.hh" @@ -34,50 +34,121 @@ /////////////////////////////////////////////////////////////////////////// // senf::log::Target +// senf::log::Target::route + +#ifndef DOXYGEN + template -prefix_ void senf::log::Target::route() +prefix_ void senf::log::Target::route(action_t action, int index) +{ + route(&Stream::instance(), 0, NONE::value, action, index); +} + +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) +{ + route(&Stream::instance(), 0, Level::value, action, index); +} + +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) { - route(&Stream::instance(), 0, NONE::value); + route(&Stream::instance(), &Area::instance(), NONE::value, action, index); } -template -prefix_ void senf::log::Target::route() +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) { - route(&Stream::instance(), static_cast(0)); + route(&Stream::instance(), &AreaClass::SENFLogArea::instance(), NONE::value, action, index); } template -prefix_ void senf::log::Target::route() +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) { - route(&Stream::instance(), &Area::instance(), Level::value); + route(&Stream::instance(), &Area::instance(), Level::value, action, index); } -//////////////////////////////////////// -// private members +template +prefix_ void senf::log::Target:: +route(action_t action, int index, + typename boost::enable_if< boost::is_convertible >::type *) +{ + route(&Stream::instance(), &AreaClass::SENFLogArea::instance(), Level::value, action, index); +} + +// senf::log::target::ununroute + +template +prefix_ void senf::log::Target::unroute(action_t action) +{ + unroute(&Stream::instance(), 0, NONE::value, action); +} -template -prefix_ void senf::log::Target::route(detail::StreamBase const * stream, - detail::AreaBase const *) +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) { - route(stream, &Area::instance(), NONE::value); + unroute(&Stream::instance(), 0, Level::value, action); } -template -prefix_ void senf::log::Target::route(detail::StreamBase const * stream, - detail::LevelBase const *) +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) { - route(stream, 0, Level::value); + unroute(&Stream::instance(), &Area::instance(), NONE::value, action); } +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) +{ + unroute(&Stream::instance(), &AreaClass::SENFLogArea::instance(), NONE::value, action); +} + +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) +{ + unroute(&Stream::instance(), &Area::instance(), Level::value, action); +} + +template +prefix_ void senf::log::Target:: +unroute(action_t action, + typename boost::enable_if< boost::is_convertible >::type *) +{ + unroute(&Stream::instance(), &AreaClass::SENFLogArea::instance(), Level::value, action); +} + +#endif + /////////////////////////////////////////////////////////////////////////// -// namespace senf::log members +// namespace senf::log::detail members template -prefix_ void senf::log::write(std::string msg) +prefix_ void senf::log::detail::write(std::string msg) { TargetRegistry::instance().write(Stream::instance(), Area::instance(), Level::value, msg); } +template +prefix_ void senf::log::timeSource() +{ + timeSource(std::auto_ptr(new Source())); +} + ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_