[Libguestfs] [libguestfs-common PATCH 0/3] don't wrap log messages written to non-TTYs

Laszlo Ersek lersek at redhat.com
Fri Feb 11 15:32:22 UTC 2022


https://bugzilla.redhat.com/show_bug.cgi?id=1820221

The first patch turns "Std_utils.wrap" into an internal (not public)
function in "Tools_utils". This is doable after guestfs-tools commit
626f0441d251 ("virt-resize: replace "wrap" calls with calls to "info"",
2022-02-10).

The second patch causes "Tools_utils.wrap" not to wrap if the output is
going to a file descriptor that does not refer to a TTY.

The third patch introduces the "-w" / "--wrap" option, for forcing the
previous behavior (making a difference only on non-TTYs). This follows
the "--colours" option's example, and if accepted, will require
documentation updates in guestfs-tools and virt-v2v.

Thanks,
Laszlo

Laszlo Ersek (3):
  Demote "Std_utils.wrap" to an internal function in Tools_utils
  Tools_utils.wrap: only wrap text for TTYs
  add common ("standard") option -w / --wrap

 mlstdutils/std_utils.ml  | 44 +++++++---------------------------------
 mlstdutils/std_utils.mli |  9 ++++----
 mltools/test-getopt.sh   |  2 ++
 mltools/tools_utils.ml   | 41 +++++++++++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 42 deletions(-)


base-commit: 5b5fac3e0b10ff4c5fd28eaa5f17ba0c163dc49b
-- 
2.19.1.3.g30247aa5d201



More information about the Libguestfs mailing list