util: Add API to enumerate Logger modules
Change-Id: Ie1361b76305b4de9746e769212efa7b381c59f91
Refs: #4013
diff --git a/src/util/logging.hpp b/src/util/logging.hpp
index 45dbe07..459cf2b 100644
--- a/src/util/logging.hpp
+++ b/src/util/logging.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -52,6 +52,11 @@
static void
addLogger(Logger& logger);
+ /** \brief get list of names of all registered loggers
+ */
+ static std::set<std::string>
+ getLoggerNames();
+
/** \brief set severity level
* \param moduleName logger name, or "*" for default level
* \param level minimum severity level
@@ -111,6 +116,9 @@
void
addLoggerImpl(Logger& logger);
+ std::set<std::string>
+ getLoggerNamesImpl();
+
void
setLevelImpl(const std::string& moduleName, LogLevel level);
@@ -160,6 +168,12 @@
get().addLoggerImpl(logger);
}
+inline std::set<std::string>
+Logging::getLoggerNames()
+{
+ return get().getLoggerNamesImpl();
+}
+
inline void
Logging::setLevel(const std::string& moduleName, LogLevel level)
{