Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log propagation issue #498

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cosmos/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def get_logger(name: str | None = None) -> logging.Logger:
[2023-08-09T14:20:55.532+0100] {subprocess.py:94} INFO - (astronomer-cosmos) - 13:20:55 Completed successfully
"""
logger = logging.getLogger(name)
logger.propagate = False
formatter: logging.Formatter = CustomTTYColoredFormatter(fmt=LOG_FORMAT) # type: ignore
handler = logging.StreamHandler()
handler.setFormatter(formatter)
Expand Down
1 change: 1 addition & 0 deletions tests/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ def test_get_logger():
assert custom_string not in standard_logger.handlers[0].formatter._fmt

custom_logger = get_logger("cosmos-log")
assert custom_logger.propagate is True
assert custom_logger.handlers[0].formatter.__class__.__name__ == "CustomTTYColoredFormatter"
assert custom_string in custom_logger.handlers[0].formatter._fmt
Loading