fix logs (and import)

This commit is contained in:
Ross
2026-06-03 21:00:05 +01:00
parent 3d445fe12e
commit 0f11f0800e
6 changed files with 18 additions and 15 deletions
+7 -3
View File
@@ -50,9 +50,13 @@ def _get_log_file_path() -> Path:
pass
try:
return Path(getattr(settings, "BASE_DIR", Path.cwd())) / "log.txt"
return Path(getattr(settings, "BASE_DIR", Path.cwd())) / "logs" / "app.log"
except Exception:
return Path.cwd() / "log.txt"
return Path.cwd() / "logs" / "app.log"
def get_log_file_path() -> Path:
return _get_log_file_path()
def configure_loguru() -> Path:
@@ -60,7 +64,7 @@ def configure_loguru() -> Path:
if _CONFIGURED:
return _get_log_file_path()
log_file_path = _get_log_file_path()
log_file_path = get_log_file_path()
log_file_path.parent.mkdir(parents=True, exist_ok=True)
stdout_level = _get_stdout_level()
log_format = "[{time:DD/MMM/YYYY HH:mm:ss}] {level} [{name}:{line}] {message}"