Skip to content

Commit c7dd384

Browse files
committed
Update logging.py
The change in logging.py was affecting other operating systems, it has now been corrected.
1 parent eadfb18 commit c7dd384

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fastapi_cli/logging.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import sys
23
from typing import Union
34

45
from rich.console import Console
@@ -9,7 +10,10 @@ def setup_logging(
910
terminal_width: Union[int, None] = None, level: int = logging.INFO
1011
) -> None:
1112
logger = logging.getLogger("fastapi_cli")
12-
console = Console(width=terminal_width or 80, emoji=False, legacy_windows=True, force_terminal=True)
13+
if sys.platform == "win32":
14+
console = Console(width=terminal_width or 80, emoji=False, legacy_windows=True)
15+
else:
16+
console = Console(width=terminal_width or 80)
1317
rich_handler = RichHandler(
1418
show_time=False,
1519
rich_tracebacks=True,

0 commit comments

Comments
 (0)