util: Add API to enumerate Logger modules
Change-Id: Ie1361b76305b4de9746e769212efa7b381c59f91
Refs: #4013
diff --git a/src/util/logging.cpp b/src/util/logging.cpp
index 89d0fd7..13fd36d 100644
--- a/src/util/logging.cpp
+++ b/src/util/logging.cpp
@@ -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).
*
@@ -23,6 +23,8 @@
#include "logger.hpp"
#include <boost/log/expressions.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/range/adaptor/map.hpp>
#include <cstdlib>
#include <fstream>
@@ -66,6 +68,16 @@
logger.setLevel(level);
}
+std::set<std::string>
+Logging::getLoggerNamesImpl()
+{
+ std::lock_guard<std::mutex> lock(m_mutex);
+
+ std::set<std::string> loggerNames;
+ boost::copy(m_loggers | boost::adaptors::map_keys, std::inserter(loggerNames, loggerNames.end()));
+ return loggerNames;
+}
+
#ifdef NDN_CXX_HAVE_TESTS
bool
Logging::removeLogger(Logger& logger)