Project

General

Profile

Task #1113

Updated by Junxiao Shi over 10 years ago

The logging module should provide services for debug and release diagnostic for all NFD code. It is not only used in development phase, but also included in the release code so that operator can turn on logging to nail down a problem within the network node. 

 API 
 === 

 NFD logging module should provide a set of precompiler macros with the following interface: 

     NFD_LOG_TRACE(<streaming expression>) 
     NFD_LOG_DEBUG(<streaming expression>) 
     NFD_LOG_WARN(<streaming expression>) 
     NFD_LOG_INFO(<streaming expression>) 
     NFD_LOG_ERROR(<streaming expression>) 
     NFD_LOG_FATAL(<streaming expression>) 

 The implementation MUST NOT execute if the specific log level is turned off. 

 Granularity of the logging 
 ================ 

 The above logging API macros should operate on the "default" logger, that should be created for the selected module (component) with the following macro: 

     NFD_LOG_INIT(<module-name>) 

 Additional logging API macros can provide more granular control over logging, e.g., explicitly specifying logging module as part of ``NFD_LOG_*`` methods. 

 
 Logging initialization 
 ====================== 

 Logging framework should provide functionality to configure default log level at compile time (completely disabling ``TRACE`` level and turning off ``DEBUG`` and ``INFO`` levels) and at run-time. 

 Other 
 === 

 Implementation ideas can be borrowed (in simplified form) from Boost.Log (http://boost-log.sourceforge.net/libs/log/doc/html/index.html) or log4cxx (https://logging.apache.org/log4cxx/).

Back