src.ctf.fs: Add `LoggingItemVisitor`
While developing, I found it useful to print the sequence of items seen
by a given visitor, so I would make the various visitor methods print
some information. Instead of re-implementing it in the various
visitors, I eventually extracted the functionality in its own visitor
(the one this patch adds).
This visitor logs details about the visited items. Indentation is used
to represent the items that are logically nested in other ones. For
example, everything between a ScopeBeginItem / ScopeEndItem pair gets
nested.
The logging is done unconditionally. The intent is that the caller uses
something like:
if (BT_LOG_ON_TRACE) {
item.accept(loggingVisitor);
}
to log at a given log level.
Philippe's changes:
* Add usage comments to `logging-item-visitor.hpp`.
* Move enumerator-to-string functions to `logging-item-visitor.cpp`.
* Move templates and everything `static` to `logging-item-visitor.cpp`.
* Log more details about some items.
* Reduce code redundancy.
* Use the standard Babeltrace 2 log statement format (therefore removing
indentation).
* Log with BT_CLOGT() instead of BT_CLOGD().
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ie8a95217564bfbaa59f78793d7ba0b47aad1d882
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8202
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12711
This page took 0.024484 seconds and 4 git commands to generate.