Skip to content

Commit 8062ebc

Browse files
committed
save logs to working directory + disable debug logs by default
1 parent b1fa4de commit 8062ebc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

desktop-tool/autofill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def prompt_if_no_arguments(prompt: str) -> Union[str, bool]:
114114
)
115115
@click.option(
116116
"--debug-logs/--no-debug-logs",
117-
default=True,
117+
default=False,
118118
help="If True, debug logs about the tool's actions will be logged to autofill_log.txt in the tool's directory.",
119119
is_flag=True,
120120
)

desktop-tool/src/logging.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import logging
2+
import os
23
from copy import copy
34

5+
from src.io import CURRDIR
46
from src.utils import TEXT_BOLD, TEXT_END
57

68

@@ -32,13 +34,13 @@ def configure_loggers(log_debug_to_file: bool) -> None:
3234
stdout_handler.addFilter(ConsoleLogFilter())
3335
logger.addHandler(stdout_handler)
3436

35-
file_crash_logger = logging.FileHandler("autofill_crash_log.txt")
37+
file_crash_logger = logging.FileHandler(os.path.join(CURRDIR, "autofill_crash_log.txt"))
3638
file_crash_logger.setLevel(logging.ERROR)
3739
file_crash_logger.setFormatter(FileLogFormatter(format_string))
3840
logger.addHandler(file_crash_logger)
3941

4042
if log_debug_to_file:
41-
file_debug_logger = logging.FileHandler("autofill_log.txt")
43+
file_debug_logger = logging.FileHandler(os.path.join(CURRDIR, "autofill_log.txt"))
4244
file_debug_logger.setLevel(logging.DEBUG)
4345
file_debug_logger.setFormatter(FileLogFormatter(format_string))
4446
logger.addHandler(file_debug_logger)

0 commit comments

Comments
 (0)