Implement support for NO_COLOR/FORCE_COLOR env with isatty and journald checks for autodetection.

This commit is contained in:
2026-09-12 22:07:37 +00:00
parent ab5b7584c9
commit 2e6f48bac5
7 changed files with 117 additions and 23 deletions
+3 -1
View File
@@ -71,7 +71,9 @@ def test_log_change_no_diff(capsys):
assert "test" in captured.err
def test_log_change_appends_extra_string(capsys):
def test_log_change_appends_extra_string(capsys, monkeypatch):
monkeypatch.setenv("FORCE_COLOR", "1")
monkeypatch.delenv("NO_COLOR", raising=False)
kanta_logger = logging.getLogger("kanta")
kanta_logger.handlers.clear()
configure_logging()