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/face/datagram-face.hpp b/daemon/face/datagram-face.hpp
index cbda459..f59374f 100644
--- a/daemon/face/datagram-face.hpp
+++ b/daemon/face/datagram-face.hpp
@@ -8,6 +8,7 @@
 #define NFD_FACE_DATAGRAM_FACE_HPP
 
 #include "face.hpp"
+#include "core/logger.hpp"
 
 namespace nfd {
 
@@ -30,14 +31,14 @@
 
   virtual
   ~DatagramFace();
-  
+
   // from Face
   virtual void
   sendInterest(const Interest& interest);
-  
+
   virtual void
   sendData(const Data& data);
-  
+
   virtual void
   close();
 
@@ -54,13 +55,13 @@
    */
   void
   resetRecentUsage();
-  
+
   bool
   hasBeenUsedRecently() const;
 
   void
   setOnDemand(bool isOnDemand);
-  
+
 protected:
   void
   receiveDatagram(const uint8_t* buffer,
@@ -69,10 +70,10 @@
 
   void
   keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face);
-  
+
   void
   closeSocket();
-  
+
 protected:
   shared_ptr<typename protocol::socket> m_socket;
   uint8_t m_inputBuffer[MAX_NDN_PACKET_SIZE];
@@ -101,7 +102,7 @@
 DatagramFace<T>::~DatagramFace()
 {
 }
-  
+
 template <class T>
 inline void
 DatagramFace<T>::sendInterest(const Interest& interest)
@@ -110,10 +111,10 @@
   m_socket->async_send(boost::asio::buffer(interest.wireEncode().wire(),
                                            interest.wireEncode().size()),
                        bind(&DatagramFace<T>::handleSend, this, _1, interest.wireEncode()));
-    
+
   // anything else should be done here?
 }
-  
+
 template <class T>
 inline void
 DatagramFace<T>::sendData(const Data& data)
@@ -122,7 +123,7 @@
   m_socket->async_send(boost::asio::buffer(data.wireEncode().wire(),
                                            data.wireEncode().size()),
                        bind(&DatagramFace<T>::handleSend, this, _1, data.wireEncode()));
-    
+
   // anything else should be done here?
 }
 
@@ -134,20 +135,20 @@
   if (error != 0) {
     if (error == boost::system::errc::operation_canceled) // when socket is closed by someone
       return;
-    
+
     if (!m_socket->is_open())
     {
       onFail("Tunnel closed");
       return;
     }
-    
+
     NFD_LOG_WARN("[id:" << this->getId()
                   << ",endpoint:" << m_socket->local_endpoint()
                   << "] Send operation failed, closing socket: "
                   << error.category().message(error.value()));
-    
+
     closeSocket();
-    
+
     if (error == boost::asio::error::eof)
     {
       onFail("Tunnel closed");
@@ -159,24 +160,24 @@
     }
     return;
   }
-  
+
   NFD_LOG_TRACE("[id:" << this->getId()
                 << ",endpoint:" << m_socket->local_endpoint()
                 << "] Successfully sent: " << wire.size() << " bytes");
   // do nothing (needed to retain validity of wire memory block
 }
-  
+
 template <class T>
 inline void
 DatagramFace<T>::close()
 {
   if (!m_socket->is_open())
     return;
-    
+
   NFD_LOG_INFO("[id:" << this->getId()
                << ",endpoint:" << m_socket->local_endpoint()
                << "] Close tunnel");
-    
+
   closeSocket();
   onFail("Close tunnel");
 }
@@ -273,20 +274,20 @@
 DatagramFace<T>::keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face)
 {
 }
-  
+
 template <class T>
 inline void
 DatagramFace<T>::closeSocket()
 {
   NFD_LOG_DEBUG("closeSocket  " << m_socket->local_endpoint());
   boost::asio::io_service& io = m_socket->get_io_service();
-    
+
   // use the non-throwing variants and ignore errors, if any
   boost::system::error_code error;
   m_socket->shutdown(protocol::socket::shutdown_both, error);
   m_socket->close(error);
   // after this, handlers will be called with an error code
-    
+
   // ensure that the Face object is alive at least until all pending
   // handlers are dispatched
   io.post(bind(&DatagramFace<T>::keepFaceAliveUntilAllHandlersExecuted,