core: change logging from environment variable to configuration file-based

GlobalConfigurationFixture uses unit-tests.conf to determine default
and module specific logging levels. Logging will gracefully default to
INFO if unit-tests.conf is not found. See unit-tests.conf.sample for a
sample configuration file.

refs: #1375, #1267

Change-Id: Ib0c4eb4149748e6658f94ef1afa23ddd3072c0fa
diff --git a/daemon/mgmt/command-validator.cpp b/daemon/mgmt/command-validator.cpp
index fd8a124..eb76572 100644
--- a/daemon/mgmt/command-validator.cpp
+++ b/daemon/mgmt/command-validator.cpp
@@ -5,6 +5,8 @@
  */
 
 #include "command-validator.hpp"
+#include "core/logger.hpp"
+
 #include <ndn-cpp-dev/util/io.hpp>
 #include <ndn-cpp-dev/security/identity-certificate.hpp>
 
@@ -178,4 +180,3 @@
 }
 
 } // namespace nfd
-
diff --git a/daemon/mgmt/command-validator.hpp b/daemon/mgmt/command-validator.hpp
index 290cabd..0162796 100644
--- a/daemon/mgmt/command-validator.hpp
+++ b/daemon/mgmt/command-validator.hpp
@@ -7,6 +7,7 @@
 #ifndef NFD_MGMT_COMMAND_VALIDATOR_HPP
 #define NFD_MGMT_COMMAND_VALIDATOR_HPP
 
+#include "common.hpp"
 #include "config-file.hpp"
 #include <ndn-cpp-dev/util/command-interest-validator.hpp>
 
@@ -19,6 +20,7 @@
   class Error : public std::runtime_error
   {
   public:
+    explicit
     Error(const std::string& what)
       : std::runtime_error(what)
     {
diff --git a/daemon/mgmt/config-file.cpp b/daemon/mgmt/config-file.cpp
index d0eddd5..bc1a495 100644
--- a/daemon/mgmt/config-file.cpp
+++ b/daemon/mgmt/config-file.cpp
@@ -4,8 +4,8 @@
  * See COPYING for copyright and distribution information.
  */
 
-
 #include "config-file.hpp"
+#include "core/logger.hpp"
 
 #include <boost/property_tree/info_parser.hpp>
 
@@ -105,4 +105,3 @@
 }
 
 }
-
diff --git a/daemon/mgmt/config-file.hpp b/daemon/mgmt/config-file.hpp
index 15eca05..dd5a43c 100644
--- a/daemon/mgmt/config-file.hpp
+++ b/daemon/mgmt/config-file.hpp
@@ -25,6 +25,7 @@
   class Error : public std::runtime_error
   {
   public:
+    explicit
     Error(const std::string& what)
       : std::runtime_error(what)
     {
@@ -86,4 +87,3 @@
 
 
 #endif // NFD_MGMT_CONFIG_FILE_HPP
-
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 518021a..55f4d9c 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -6,6 +6,7 @@
 
 #include "face-manager.hpp"
 
+#include "core/logger.hpp"
 #include "core/face-uri.hpp"
 #include "core/network-interface.hpp"
 #include "fw/face-table.hpp"
diff --git a/daemon/mgmt/face-status-publisher.cpp b/daemon/mgmt/face-status-publisher.cpp
index 89c731e..3589d7b 100644
--- a/daemon/mgmt/face-status-publisher.cpp
+++ b/daemon/mgmt/face-status-publisher.cpp
@@ -3,7 +3,9 @@
  * Copyright (C) 2014 Named Data Networking Project
  * See COPYING for copyright and distribution information.
  */
+
 #include "face-status-publisher.hpp"
+#include "core/logger.hpp"
 
 namespace nfd {
 
diff --git a/daemon/mgmt/fib-enumeration-publisher.cpp b/daemon/mgmt/fib-enumeration-publisher.cpp
index 79532ba..b672e7e 100644
--- a/daemon/mgmt/fib-enumeration-publisher.cpp
+++ b/daemon/mgmt/fib-enumeration-publisher.cpp
@@ -6,7 +6,7 @@
 
 #include "fib-enumeration-publisher.hpp"
 
-#include "common.hpp"
+#include "core/logger.hpp"
 
 #include <ndn-cpp-dev/management/nfd-fib-entry.hpp>
 
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 0bf4f34..34554e6 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -6,6 +6,7 @@
 
 #include "fib-manager.hpp"
 
+#include "core/logger.hpp"
 #include "table/fib.hpp"
 #include "fw/forwarder.hpp"
 #include "mgmt/internal-face.hpp"
diff --git a/daemon/mgmt/internal-face.cpp b/daemon/mgmt/internal-face.cpp
index 81bd2de..a5bcf5a 100644
--- a/daemon/mgmt/internal-face.cpp
+++ b/daemon/mgmt/internal-face.cpp
@@ -5,6 +5,7 @@
  */
 
 #include "internal-face.hpp"
+#include "core/logger.hpp"
 #include "core/global-io.hpp"
 
 namespace nfd {
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index 08d845c..e608ffc 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -5,6 +5,7 @@
  */
 
 #include "manager-base.hpp"
+#include "core/logger.hpp"
 
 namespace nfd {
 
diff --git a/daemon/mgmt/segment-publisher.cpp b/daemon/mgmt/segment-publisher.cpp
index 82ae31e..993330f 100644
--- a/daemon/mgmt/segment-publisher.cpp
+++ b/daemon/mgmt/segment-publisher.cpp
@@ -6,7 +6,7 @@
 
 #include "segment-publisher.hpp"
 
-#include "common.hpp"
+#include "core/logger.hpp"
 #include "face/face.hpp"
 
 #include <ndn-cpp-dev/util/time.hpp>
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index a4c4e38..43824f2 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -6,6 +6,7 @@
 
 #include "strategy-choice-manager.hpp"
 #include "table/strategy-choice.hpp"
+#include "core/logger.hpp"
 #include "mgmt/app-face.hpp"
 
 namespace nfd {
@@ -166,5 +167,3 @@
 
 
 } // namespace nfd
-
-