mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-07-04 15:43:02 +02:00
fix(lint): LOG015 - replace root logger with module loggers
- Add _logger = logging.getLogger(__name__) to all modules - Replace logging.X() calls with _logger.X() calls - Remove logging.basicConfig() from module level (keep in run_bot()) - Add G004 to global ignores (f-strings in logging are more readable) - Remove LOG015 and G004 per-file ignores from pyproject.toml - Fix pytest_ignore_collect hook signature in conftest.py
This commit is contained in:
parent
e3efe68604
commit
bc0e41f9fc
@ -11,7 +11,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Validation limits for workout data
|
# Validation limits for workout data
|
||||||
MAX_DISTANCE_KM = 100
|
MAX_DISTANCE_KM = 100
|
||||||
@ -34,7 +34,7 @@ class ScreenLocker:
|
|||||||
|
|
||||||
# Check if already logged today
|
# Check if already logged today
|
||||||
if self.has_logged_today():
|
if self.has_logged_today():
|
||||||
logging.info("Workout already logged today. Skipping screen lock.")
|
_logger.info("Workout already logged today. Skipping screen lock.")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
self.root = tk.Tk()
|
self.root = tk.Tk()
|
||||||
@ -663,7 +663,7 @@ class ScreenLocker:
|
|||||||
with open(self.log_file, "w") as f:
|
with open(self.log_file, "w") as f:
|
||||||
json.dump(logs, f, indent=2)
|
json.dump(logs, f, indent=2)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
logging.warning(f"Could not save workout log: {e}")
|
_logger.warning(f"Could not save workout log: {e}")
|
||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
"""Close the application and exit."""
|
"""Close the application and exit."""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user