From 5c11864b476b33505b9d5ace151ab69b3f2c927e Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 27 May 2026 13:07:46 +0100 Subject: [PATCH] Log to stderr and print email body to a file This allows doing `uv run -m bugbot.rules. > output.html` and checking the rendered output. --- bugbot/__init__.py | 2 +- bugbot/mail.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bugbot/__init__.py b/bugbot/__init__.py index c95b0f836..0ffc6ab35 100644 --- a/bugbot/__init__.py +++ b/bugbot/__init__.py @@ -65,7 +65,7 @@ def create_logger(logger_extra): logger = logging.getLogger() logger.setLevel(logging.INFO) - handler = logging.StreamHandler(sys.stdout) + handler = logging.StreamHandler(sys.stderr) handler.setFormatter(formatter) logger.addHandler(handler) diff --git a/bugbot/mail.py b/bugbot/mail.py index a4a290f56..73485519e 100644 --- a/bugbot/mail.py +++ b/bugbot/mail.py @@ -92,6 +92,8 @@ def send( if subtype == "html": Body = replaceUnicode(Body) + if dryrun: + print(Body) message.attach(MIMEText(Body, subtype)) for file in files: