From: Thomas Huth <thuth@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 1/2] tests/functional: include logger name and function in messages
Date: Wed, 29 Oct 2025 08:06:39 +0100 [thread overview]
Message-ID: <4c03b66c-5e0c-46cb-80d3-e91a67d4e532@redhat.com> (raw)
In-Reply-To: <20251028182651.873256-2-berrange@redhat.com>
On 28/10/2025 19.26, Daniel P. Berrangé wrote:
> As we collect debug logs from a wide range of code it becomes
> increasingly confusing to understand where each log messages comes
> from. Adding "%(name)s" gives us the logger name, which is usually
> based on the python __name__ symbol, aka the code module name.
> Then "%(funcName)s" completes the story by identifying the function.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> tests/functional/qemu_test/testcase.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
> index 2c0abde395..6fc6e1ac0a 100644
> --- a/tests/functional/qemu_test/testcase.py
> +++ b/tests/functional/qemu_test/testcase.py
> @@ -217,7 +217,7 @@ def setUp(self):
> self._log_fh = logging.FileHandler(self.log_filename, mode='w')
> self._log_fh.setLevel(logging.DEBUG)
> fileFormatter = logging.Formatter(
> - '%(asctime)s - %(levelname)s: %(message)s')
> + '%(asctime)s - %(levelname)s: %(name)s.%(funcName)s %(message)s')
> self._log_fh.setFormatter(fileFormatter)
> self.log.addHandler(self._log_fh)
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
next prev parent reply other threads:[~2025-10-29 7:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 18:26 [PATCH 0/2] tests/functional: collect more info in base.log file Daniel P. Berrangé
2025-10-28 18:26 ` [PATCH 1/2] tests/functional: include logger name and function in messages Daniel P. Berrangé
2025-10-29 7:06 ` Thomas Huth [this message]
2025-10-28 18:26 ` [PATCH 2/2] tests/functional: include the lower level QMP log messages Daniel P. Berrangé
2025-10-29 7:12 ` Thomas Huth
2025-10-29 8:12 ` Daniel P. Berrangé
2025-10-29 8:30 ` Thomas Huth
2025-10-29 9:00 ` Daniel P. Berrangé
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=4c03b66c-5e0c-46cb-80d3-e91a67d4e532@redhat.com \
--to=thuth@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.