Project

General

Profile

Actions

Feature #4969

closed

Use logging attributes (timestamp, severity)

Added by Alex Afanasyev over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Utils
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Tags:

Description

Currently, when we producing the log, we hard-code formatting of the log statement, including timestamp, severity level, and the actual message. Boost.Log provides facilities to separate different types of information into distinct "attributes" and then access these attributes during actual printing of the message using the so-called formatters.

One implication of this change would be the change in the appearance of the "timestamp" part in the log messages. Specifically, the current line

1562868667.788530 DEBUG: [ndn.UnixTransport] connect path=/private/tmp/nfd.sock

would look like

20190711T14:11:07.788530 DEBUG: [ndn.UnixTransport] connect path=/private/tmp/nfd.sock

We can adjust the specific formatting of the string, it just not going to be seconds since the epoch, but the actual datetime value. Out-of-box, we can easily to UTC date. To print local timezone stuff would require some extra work.


This issue is necessary to support native Android logging and should help to implement with issue #1604. In both cases, the timestamp will be added by the corresponding subsystems and attributes will be used to extract the severity level of the message.


Related issues 2 (1 open1 closed)

Blocks ndn-cxx - Feature #4970: Native support for Android loggingClosedAlex Afanasyev

Actions
Blocks ndn-cxx - Feature #1604: syslog & journald log destinationsNew

Actions
Actions #1

Updated by Alex Afanasyev over 5 years ago

Reversing my decision regarding the change of the timestamp. We, actually, have to use timestamp that is based on our time::system_clock (as it can be overridden with tests and NS-3). Therefore, we have to customize and if customize, the easy way is to keep the existing timestamp formatting. So, the patches I will be pushing soon will change the framework, but will not alter the visible output.

Actions #2

Updated by Alex Afanasyev over 5 years ago

  • Status changed from New to Code review
Actions #3

Updated by Davide Pesavento over 5 years ago

  • Target version changed from 0.8.0 to v0.7
  • Start date deleted (07/11/2019)
Actions #4

Updated by Davide Pesavento over 5 years ago

Actions #5

Updated by Davide Pesavento over 5 years ago

Actions #6

Updated by Davide Pesavento over 5 years ago

  • Status changed from Code review to Closed
  • % Done changed from 0 to 100
Actions #7

Updated by Davide Pesavento about 1 year ago

  • Tags set to logging
Actions

Also available in: Atom PDF