Task #1113
closedImplementation of the logging module for NFD
100%
Description
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/).
Updated by Junxiao Shi almost 11 years ago
As a user of the logging module, where should NFD_LOG_INIT(<module-name>)
be placed in the source file?
Should it be placed inside every procedure that needs logging functionality, or should it be placed in a .cpp file but outside of procedures?
Updated by Alex Afanasyev almost 11 years ago
Outside of procedures in .cpp file. For example, like it is done in NS-3 (or ChronoSync https://github.com/named-data/ChronoSync/blob/master/src/sync-logic.cc). Basically, this macro should create and initialize static variable.
Updated by Junxiao Shi almost 11 years ago
Given this task has priority=Urgent, it should be assigned as soon as code repository is ready on gerrit.
Updated by Alex Afanasyev almost 11 years ago
- Priority changed from Urgent to Immediate
- Target version set to Mock
Updated by Ilya Moiseenko almost 11 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Not a full implementation for a moment.
Updated by Alex Afanasyev almost 11 years ago
- Status changed from Resolved to Code review
Updated by Alex Afanasyev almost 11 years ago
- Category set to Core
- Priority changed from Immediate to Normal
Updated by Alex Afanasyev almost 11 years ago
- Status changed from Code review to Closed