Closed frwbr closed 2 months ago
We will need to consider our options here. stderr is definitely meant for errors - and this message is not 'error' - it's a suggesting info message.
So in your case - check lvm.conf and set this: log { report_command_log = 1 } This should separate command logging into a dedicated json section "log":
However we have noticed there are some weird stuff - so there might be possible some patch needed for correction functionality.
Question is - whether this should be a default.
Also for considering could be to recognize 'non-shell' stdout and possibly behave differently and use this separate logging in auto-detected more (i.e. = 2)
Some more options how to solve this are likely possible.
This should be resolved now with: https://gitlab.com/lvmteam/lvm2/-/merge_requests/11 (lvm v2.03.26).
If the archive for a VG is too large,
vgs
prints a message that recommends pruning it to stdout [1], which breaks JSON output. Minimal reproducer (for a VG namedspam
):Passing
-qq
silences the warning, which is fine as a workaround, but printing the message to stderr instead of stdout might be nicer. What do you think?There might be other messages being printed to stdout that cause similar problems, but I only saw this particular message so far.
[1] https://sourceware.org/git/?p=lvm2.git;a=blob;f=lib/format_text/archive.c;h=5acf0c04a;hb=38e0c7a1#l222