Project

General

Profile

Actions

Task #1113

closed

Implementation of the logging module for NFD

Added by Alex Afanasyev over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Core
Target version:
Start date:
01/20/2014
Due date:
% Done:

100%

Estimated time:
16.00 h

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/).

Actions

Also available in: Atom PDF