Description
The eapp.better_logging() function causes double logging - each log message appears twice.
Commit eacd5c9 added py_logging.getLogger().addHandler(python_handler) which creates a duplicate logging path since ABSLHandler already delegates to python_handler internally.
Reproduction
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "etils[eapp]",
# "absl-py",
# ]
# ///
"""Minimal working example showing double logging bug."""
import logging
from absl import app
from etils import eapp
def main(_):
logging.info("Hello world")
if __name__ == "__main__":
eapp.better_logging()
app.run(main)
Run with: uv run test_double_logging.py
Output shows double logging:
I 15:55:04 [test_double_logging.py:18]: Hello world
I 15:55:04 [test_double_logging.py:18]: Hello world
Description
The
eapp.better_logging()function causes double logging - each log message appears twice.Commit eacd5c9 added
py_logging.getLogger().addHandler(python_handler)which creates a duplicate logging path sinceABSLHandleralready delegates topython_handlerinternally.Reproduction
Run with:
uv run test_double_logging.pyOutput shows double logging: