aboutsummaryrefslogtreecommitdiff
path: root/tools/virtiofsd/buffer.c
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2020-03-30 20:00:14 -0400
committerMax Reitz <mreitz@redhat.com>2020-05-05 13:17:36 +0200
commit52ea799e9631ff00c230f1fed50986246149d8f2 (patch)
tree92338491f7d9490434ae1a0a31121ef22c581e9f /tools/virtiofsd/buffer.c
parent59c29869e0c5e8875edc50a0e3073eeaa8fe6143 (diff)
iotests: use python logging for iotests.log()
We can turn logging on/off globally instead of per-function. Remove use_log from run_job, and use python logging to turn on diffable output when we run through a script entry point. iotest 245 changes output order due to buffering reasons. An extended note on python logging: A NullHandler is added to `qemu.iotests` to stop output from being generated if this code is used as a library without configuring logging. A NullHandler is only needed at the root, so a duplicate handler is not needed for `qemu.iotests.diff_io`. When logging is not configured, messages at the 'WARNING' levels or above are printed with default settings. The NullHandler stops this from occurring, which is considered good hygiene for code used as a library. See https://docs.python.org/3/howto/logging.html#library-config When logging is actually enabled (always at the behest of an explicit call by a client script), a root logger is implicitly created at the root, which allows messages to propagate upwards and be handled/emitted from the root logger with default settings. When we want iotest logging, we attach a handler to the qemu.iotests.diff_io logger and disable propagation to avoid possible double-printing. For more information on python logging infrastructure, I highly recommend downloading the pip package `logging_tree`, which provides convenient visualizations of the hierarchical logging configuration under different circumstances. See https://pypi.org/project/logging_tree/ for more information. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200331000014.11581-15-jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tools/virtiofsd/buffer.c')
0 files changed, 0 insertions, 0 deletions