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

Use newly added colcon_core.logging.get_effective_console_level #16

Merged
merged 4 commits into from
Jun 24, 2024
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
10 changes: 2 additions & 8 deletions colcon_alias/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@
import logging

from colcon_core.logging import colcon_logger


def _get_effective_log_level():
for handler in colcon_logger.handlers:
if isinstance(handler, logging.StreamHandler):
return handler.level
return logging.WARNING
from colcon_core.logging import get_effective_console_level


def configure_filelock_logger():
"""Configure the 'filelock' log level based on colcon's log level."""
log_level = _get_effective_log_level()
log_level = get_effective_console_level(colcon_logger)
logging.getLogger('filelock').setLevel(log_level)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ keywords = colcon
[options]
python_requires = >=3.6
install_requires =
colcon-core
colcon-core>=0.17.0
filelock
PyYAML
packages = find:
Expand Down
2 changes: 1 addition & 1 deletion stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[colcon-alias]
No-Python2:
Depends3: python3-colcon-core, python3-filelock, python3-yaml
Depends3: python3-colcon-core (>= 0.17.0), python3-filelock, python3-yaml
Conflicts3: python3-colcon-mixin (< 0.2.2)
Suite: focal jammy noble bookworm trixie
X-Python3-Version: >= 3.6
Loading