Re: [PATCH 1/1] logging: change logging format to drop "[file:line] func():" part



On Thu, 2016-02-25 at 21:53 +0100, Beniamino Galvani wrote:
On Thu, Feb 25, 2016 at 05:21:29PM +0100, Thomas Haller wrote:
- the timestamp: I find it useful to see how much time between two
  events passed. The timestamp printed by syslog doesn't have
sufficient
  granularity, and the internal journal fields are not readily
available.
  We used to print the timestamps for <error>, <debug> and <trace>,
  but ommited them for <info> and <warn> levels. We now print them
for
  all levels, also to preserve alignment.
I find it useful too. Maybe we can reduce the decimal digits to 4 and
use a relative timestamp to further reduce line length:

  [001168.0381] platform-linux: udev-remove: IFINDEX=6

yeah, possible.

Note that truncating to msec precision saves merely 2 chars (OK, fair enough).

[001168.0381] wraps after 11 days, for saving ~only~ 4 chars.


instead of:

  [1456431168.038195] platform-linux: udev-remove: IFINDEX=6



currently we use gettimeofday(). We could also use
nm_utils_get_monotonic_time() or CLOCK_BOOTTIME... with different pros
and cons.
gettimeofday() is affected by systemclock and can contain jumps. Still
on a proper setup with ntp, it will be closer to the real time then the
monotonic clock.
gettimeofday() never repeats (apart resetting clock), but
CLOCK_BOOTTIME repeats itself on every boot and
nm_utils_get_monotonic_time() repeats on every run.


Thomas


Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]