adobe / adobe/himl

[BUG] Importing himl adds root logging formatter which affects application logging.

Open
#210 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
135
Forks
34
PR merge metrics
No merged PRs in 30d

Description

## Bug Description

A change somewhere between v0.16.0 and v0.18.0 has caused applications that import himl and use a custom log formatter to receive duplicated log messages.

## To Reproduce

```
$ cat himl_logging_bug.py
import argparse
import logging

parser = argparse.ArgumentParser()
parser.add_argument("--himl", action="store_true", help="Import himl")
args = parser.parse_args()
if args.himl:
import himl

logger = logging.getLogger("my_logger")
logger.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(name)s - %(message)s")
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
logger.addHandler(console_handler)

logger.info("Test log message")

$ pip install himl==0.16.0 &>/dev/null

$ python himl_logging_bug.py
2025-12-03 12:02:40,599 - INFO - my_logger - Test log message

$ python himl_logging_bug.py --himl
2025-12-03 12:02:43,993 - INFO - my_logger - Test log message

$ pip install himl==0.18.0 &>/dev/null

$ python himl_logging_bug.py
2025-12-03 12:02:54,574 - INFO - my_logger - Test log message

$ python himl_logging_bug.py --himl
2025-12-03 12:02:56,520 - INFO - my_logger - Test log message
INFO:my_logger:Test log message
```

## Expected Behavior

Importing himl does not affect application logging.

## Actual Behavior

Importing himl causes duplicated log messages.

## Environment

- OS: Fedora 42
- Python version: 3.13.7
- himl version: 0.18.0
- Installation method: pip

Contributor guide

Open the contributing guide

Research direction

Start by running the issue's himl_logging_bug.py reproduction with and without the --himl flag, then trace what the himl import initializes in its package entry point. Done means importing himl leaves the application's custom logging output unchanged, with the test message emitted only once.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.