updateRoutingCache(stream, i->second);
return;
}
+ if (! area->alive())
+ // We are globally destructing and the area is gone already ...
+ return;
unsigned limit (DISABLED::value);
RIB::iterator i (rib_.begin());
RIB::iterator const i_end (rib_.end());
std::string formatLabel(std::string const & l)
{
if (l.empty())
- return "-";
+ return "*";
if (l.size() > 29)
return l.substr(l.size()-29);
return l;
prefix_ void senf::log::Target::consoleList(std::ostream & os)
{
static char const * levels[] = {
- "none", "verbose", "notice", "message", "important", "critical", "fatal", "disabled" };
+ "verbose", "verbose", "notice", "message", "important", "critical", "fatal", "disabled" };
boost::format fmt ("%2d %-29s %-29s %-9s %-6s\n");
os << fmt % "#" % "STREAM" % "AREA" % "LEVEL" % "ACTION";
" message (senf::log::DefaultArea NOTICE) \"Test notice\";\n"
" message (FATAL) \"Program on fire\";\n"
" message (VERBOSE senf::log::Debug) \"Debug message\";");
+ consoleDir_().add("self", senf::membind(&TargetRegistry::consoleSelf, this))
+ .doc("Get the log directory of the current network client. Example usage:\n"
+ "\n"
+ "Just get the log config directory\n"
+ " $ /sys/log/self\n"
+ " <Directory '/sys/log/client-xxx.xxx.xxx.xxx:xxx'>\n"
+ "\n"
+ "Route all messages to the currently connected client\n"
+ " $ /sys/log/self { route (); }");
}
prefix_ senf::log::detail::TargetRegistry::~TargetRegistry()
write(*pm.stream, *pm.area, pm.level, msg);
}
+prefix_ boost::shared_ptr<senf::console::DirectoryNode>
+senf::log::detail::TargetRegistry::consoleSelf(std::ostream & os)
+{
+ return senf::console::Client::get(os).consoleDir().node().thisptr();
+}
+
///////////////////////////////////////////////////////////////////////////
// senf::log::detail::LogParameters