Standardize log levels used by logging statements across the project
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 14 Jun 2019 20:58:49 +0000 (16:58 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
commit3f7d4d90b0456de9d34fac337350818ef06163bd
tree6426cbfb8284e8ee17c8749c653b1a2a79e2bb43
parent44ced4ff8e8b5e46ef03f3aec737fca5ca2c7003
Standardize log levels used by logging statements across the project

Let's use this approach now:

INFO level:
    Any useful information which a non-developer user would possibly
    understand.

    Anything logged with this level must _not_ happen repetitively on
    the fast path, that is, nothing related to each message, for
    example. This level is used for sporadic and one-shot events.

    * CLI or component configuration report.
    * Successful plugin, component, or message iterator initialization.
    * In the library: anything related to plugins, graphs, component
      classes, components, message iterators, connections, and ports
      which is not on the fast path.
    * Successful connection to or disconnection from another system.
    * An _optional_ subsystem cannot be loaded.
    * An _optional_ field/datum cannot be found.

DEBUG level:
    Something that only Babeltrace developers would be interested into,
    which can occur on the fast path, but not more often than once per
    message.

    * Object construction and destruction.
    * Object recycling (except fields).
    * Object copying (except fields and values).
    * Object freezing (whatever the type, as freezing only occurs in
      developer mode).
    * Object cancellation.
    * Calling user methods and logging the result.
    * Setting object properties (except fields and values).

VERBOSE level:
    Low-level debugging context information (anything that does not fit
    the other log levels). More appropriate for tracing in general.

    * Reference count change.
    * Fast path, low level state machine's state change.
    * Get or set an object's property.
    * Object comparison's intermediate results.

This will also be written in `CONTRIBUTING.adoc` by another patch.

The goal here is to make the DEBUG level the default minimal, build-time
log level, so that Babeltrace users have enough logging by default
without impacting the performance too much. From what I measured once
this patch is applied, the performance is very similar to an INFO build.

Many DEBUG logging statements are upgraded to the INFO level because
they only occur once, or very rarely, and consist of interesting
information for someone who does not have deep knowledge of the
Babeltrace source code.

Many VERBOSE logging statements are upgraded to the DEBUG level so that,
by default, we have more information in the log file of someone who
needs support. Those statements are executed seldom enough (at most once
per message) to be promoted as such.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Icdd1ec8f1f54396eea5588968d85e446030f282d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1439
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
44 files changed:
src/cli/babeltrace2.c
src/common/common.c
src/common/common.h
src/ctfser/ctfser.c
src/fd-cache/fd-cache.c
src/lib/graph/component-class-sink-colander.c
src/lib/graph/component-class.c
src/lib/graph/component.c
src/lib/graph/connection.c
src/lib/graph/graph.c
src/lib/graph/graph.h
src/lib/graph/iterator.c
src/lib/graph/message/message-iterator-inactivity.c
src/lib/graph/message/stream-activity.c
src/lib/graph/port.c
src/lib/graph/query-executor.c
src/lib/object-pool.h
src/lib/plugin/plugin-so.c
src/lib/plugin/plugin.c
src/lib/plugin/plugin.h
src/lib/trace-ir/clock-class.c
src/lib/trace-ir/event-class.c
src/lib/trace-ir/event.h
src/lib/trace-ir/field-class.c
src/lib/trace-ir/stream-class.c
src/lib/trace-ir/stream.c
src/lib/trace-ir/trace-class.c
src/lib/trace-ir/trace.c
src/plugins/ctf/common/bfcr/bfcr.c
src/plugins/ctf/common/metadata/ctf-meta-resolve.c
src/plugins/ctf/common/metadata/decoder.c
src/plugins/ctf/common/msg-iter/msg-iter.c
src/plugins/ctf/fs-sink/fs-sink-trace.c
src/plugins/ctf/fs-src/data-stream-file.c
src/plugins/ctf/fs-src/file.c
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/lttng-live/data-stream.c
src/plugins/ctf/lttng-live/lttng-live.c
src/plugins/ctf/lttng-live/viewer-connection.c
src/plugins/lttng-utils/debug-info/bin-info.c
src/plugins/lttng-utils/debug-info/debug-info.c
src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c
src/plugins/utils/muxer/muxer.c
src/python-plugin-provider/python-plugin-provider.c
This page took 0.032333 seconds and 4 git commands to generate.