00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00026 #include "Target.ih"
00027
00028
00029 #include "AreaRegistry.hh"
00030
00031 #define prefix_ inline
00032
00033
00034
00035
00036
00037 prefix_ void senf::log::Target::route(action_t action, int index)
00038 {
00039 route(0, 0, NONE::value, action, index);
00040 }
00041
00042 prefix_ void senf::log::Target::unroute(action_t action)
00043 {
00044 unroute(0, 0, NONE::value, action);
00045 }
00046
00047 prefix_ senf::log::Target::iterator senf::log::Target::begin()
00048 const
00049 {
00050 return rib_.begin();
00051 }
00052
00053 prefix_ senf::log::Target::iterator senf::log::Target::end()
00054 const
00055 {
00056 return rib_.end();
00057 }
00058
00059 prefix_ senf::log::Target::RoutingEntry const & senf::log::Target::operator[](size_type i)
00060 const
00061 {
00062 return rib_[i];
00063 }
00064
00065 prefix_ senf::log::Target::size_type senf::log::Target::size()
00066 const
00067 {
00068 return rib_.size();
00069 }
00070
00071 prefix_ bool senf::log::Target::empty()
00072 const
00073 {
00074 return rib_.empty();
00075 }
00076
00077
00078
00079
00080 prefix_ senf::log::Target::RoutingEntry::RoutingEntry(detail::StreamBase const * stream,
00081 detail::AreaBase const * area,
00082 unsigned level, action_t action)
00083 : stream_(stream), area_(area), level_(level), action_(action)
00084 {}
00085
00086 prefix_ senf::log::Target::RoutingEntry::RoutingEntry()
00087 : stream_(0), area_(0), level_(0), action_(ACCEPT)
00088 {}
00089
00090 prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other)
00091 const
00092 {
00093 return
00094 stream_ == other.stream_ &&
00095 area_ == other.area_ &&
00096 level_ == other.level_ &&
00097 action_ == other.action_;
00098 }
00099
00100 prefix_ std::string senf::log::Target::RoutingEntry::stream()
00101 const
00102 {
00103 return stream_ ? stream_->v_name() : "";
00104 }
00105
00106 prefix_ std::string senf::log::Target::RoutingEntry::area()
00107 const
00108 {
00109 return area_ ? area_->v_name() : "";
00110 }
00111
00112 prefix_ unsigned senf::log::Target::RoutingEntry::level()
00113 const
00114 {
00115 return level_;
00116 }
00117
00118 prefix_ senf::log::Target::action_t senf::log::Target::RoutingEntry::action()
00119 const
00120 {
00121 return action_;
00122 }
00123
00124
00125
00126
00127 prefix_ void senf::log::detail::TargetRegistry::routed()
00128 {
00129 fallbackRouting_ = false;
00130 }
00131
00132 prefix_ bool senf::log::detail::TargetRegistry::fallbackRouting()
00133 {
00134 return fallbackRouting_;
00135 }
00136
00137 prefix_ senf::console::ScopedDirectory<> & senf::log::detail::TargetRegistry::consoleDir()
00138 {
00139 return consoleDir_();
00140 }
00141
00142
00143
00144
00145 prefix_ void senf::log::detail::TargetRegistry::unregisterTarget(Target * target)
00146 {
00147 targets_.erase(target);
00148 }
00149
00150
00151 #undef prefix_
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162