mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-22 01:19:18 +08:00
Opt: Disable color rendering in log file
This commit is contained in:
@@ -4,9 +4,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from typing import Callable, List
|
from typing import Callable, List
|
||||||
|
|
||||||
import rich.box
|
|
||||||
from rich.console import Console, ConsoleOptions, ConsoleRenderable, NewLine
|
from rich.console import Console, ConsoleOptions, ConsoleRenderable, NewLine
|
||||||
from rich.highlighter import RegexHighlighter
|
from rich.highlighter import RegexHighlighter, NullHighlighter
|
||||||
from rich.logging import RichHandler
|
from rich.logging import RichHandler
|
||||||
from rich.rule import Rule
|
from rich.rule import Rule
|
||||||
from rich.style import Style
|
from rich.style import Style
|
||||||
@@ -199,6 +198,7 @@ def set_file_logger(name=pyw_name):
|
|||||||
file_console = Console(
|
file_console = Console(
|
||||||
file=file,
|
file=file,
|
||||||
no_color=True,
|
no_color=True,
|
||||||
|
highlight=False,
|
||||||
width=119,
|
width=119,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -210,6 +210,7 @@ def set_file_logger(name=pyw_name):
|
|||||||
rich_tracebacks=True,
|
rich_tracebacks=True,
|
||||||
tracebacks_show_locals=True,
|
tracebacks_show_locals=True,
|
||||||
tracebacks_extra_lines=3,
|
tracebacks_extra_lines=3,
|
||||||
|
highlighter=NullHighlighter(),
|
||||||
)
|
)
|
||||||
hdlr.setFormatter(file_formatter)
|
hdlr.setFormatter(file_formatter)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user