From: Eric Blake <eblake@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
Christian Schoenebeck <qemu_oss@crudebyte.com>,
qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Emanuele Giuseppe Esposito" <e.emanuelegiuseppe@gmail.com>,
"Greg Kurz" <groug@kaod.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v4 04/12] libqos/qgraph: add qos_dump_graph()
Date: Wed, 28 Oct 2020 08:00:21 -0500 [thread overview]
Message-ID: <4dde4915-8f44-d8fc-898f-bd61a40e084b@redhat.com> (raw)
In-Reply-To: <11a4d5e3-cb5d-b74d-df7e-6e5a659c63a4@redhat.com>
On 10/28/20 12:51 AM, Thomas Huth wrote:
>>>> +#define GREEN(txt) ( \
>>>> + "\033[0;92m" txt \
>>>> + "\033[0m" \
>>>> +)
>>>
>>> I don't think this is very portable - and it will only make logs ugly to
>>> read in text editors. Could you please simply drop these macros?
>>>
> Sure, colored output is nice, but we certainly also need a way to disable
> it, e.g. if you want to collect the log in a file and then have a look at it
> in a text editor.
Agreed. GNU libtextstyle
(https://www.gnu.org/software/gettext/libtextstyle/manual/libtextstyle.html)
is a much more portable way to do colored output where it becomes easy
to enable/disable or even adjust the colors to user preferences. Sadly,
it is GPLv3+, and thus unusable for qemu. But the bare minimum that you
must have when making colored output gated on whether stdout is a
terminal (that is, any program that does color should have a
--color=off|auto|on command-line option, and that in turn implies
function calls rather than macros to properly encapsulate the decision
logic.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-10-28 13:02 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 18:49 [PATCH v4 00/12] 9pfs: add tests using local fs driver Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 10/12] tests/9pfs: wipe local 9pfs test directory Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 04/12] libqos/qgraph: add qos_dump_graph() Christian Schoenebeck
2020-10-24 6:04 ` Thomas Huth
2020-10-24 11:24 ` Christian Schoenebeck
2020-10-28 5:51 ` Thomas Huth
2020-10-28 13:00 ` Eric Blake [this message]
2020-10-28 13:28 ` Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 07/12] tests/qtest/qos-test: dump QEMU command if verbose Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 02/12] libqos/qgraph: add qos_node_create_driver_named() Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 06/12] tests/qtest/qos-test: dump environment variables if verbose Christian Schoenebeck
2020-10-24 5:56 ` Thomas Huth
2020-10-24 10:57 ` Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 05/12] tests/qtest/qos-test: dump qos graph " Christian Schoenebeck
2020-10-24 6:01 ` Thomas Huth
2020-10-24 11:34 ` Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 09/12] tests/9pfs: introduce local tests Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 12/12] tests/9pfs: add local Tmkdir test Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 01/12] libqos/qgraph: add qemu_name to QOSGraphNode Christian Schoenebeck
2020-10-19 10:35 ` Christian Schoenebeck
2020-10-24 6:08 ` Thomas Huth
2020-10-24 10:39 ` Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 11/12] tests/9pfs: add virtio_9p_test_path() Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 08/12] tests/9pfs: change qtest name prefix to synth Christian Schoenebeck
2020-10-14 15:25 ` Christian Schoenebeck
2020-10-14 19:38 ` Greg Kurz
2020-10-15 9:16 ` Christian Schoenebeck
2020-10-08 18:34 ` [PATCH v4 03/12] libqos/qgraph_internal: add qos_printf() and qos_printf_literal() Christian Schoenebeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4dde4915-8f44-d8fc-898f-bd61a40e084b@redhat.com \
--to=eblake@redhat.com \
--cc=berrange@redhat.com \
--cc=e.emanuelegiuseppe@gmail.com \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).