From 3ddba11e87be32d7791144817241d29c8e36ed97 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Sun, 26 Jun 2011 16:45:44 -0700 Subject: [PATCH] Changing logging's default naming scheme. We now take the enum ID name rather than the module. Closes #483. --- src/LogMgr.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/LogMgr.cc b/src/LogMgr.cc index 6a23728ac0..db35221aff 100644 --- a/src/LogMgr.cc +++ b/src/LogMgr.cc @@ -744,13 +744,14 @@ bool LogMgr::AddFilter(EnumVal* id, RecordVal* fval) else { - // If no path is given, use the Stream ID's namespace as the default - // if it has one, and it ID itself otherwise. + // If no path is given, use the Stream ID as the default but + // strip the namespace. const char* s = stream->name.c_str(); - const char* e = strstr(s, "::"); + const char* e = s + strlen(s); - if ( ! e ) - e = s + strlen(s); + const char* t = strstr(s, "::"); + if ( t ) + s = t + 2; string path(s, e); std::transform(path.begin(), path.end(), path.begin(), ::tolower);