Project

General

Profile

Actions

Task #1113

closed

Implementation of the logging module for NFD

Added by Alex Afanasyev almost 11 years ago. Updated almost 11 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 #1

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?

Actions #2

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.

Actions #3

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.

Actions #4

Updated by Junxiao Shi almost 11 years ago

  • Description updated (diff)
Actions #5

Updated by Alex Afanasyev almost 11 years ago

  • Assignee set to Ilya Moiseenko
Actions #6

Updated by Alex Afanasyev almost 11 years ago

  • Priority changed from Urgent to Immediate
  • Target version set to Mock
Actions #7

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.

Actions #8

Updated by Alex Afanasyev almost 11 years ago

  • Status changed from Resolved to Code review
Actions #9

Updated by Alex Afanasyev almost 11 years ago

  • Category set to Core
  • Priority changed from Immediate to Normal
Actions #10

Updated by Alex Afanasyev almost 11 years ago

  • % Done changed from 50 to 100
Actions #11

Updated by Alex Afanasyev almost 11 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF