From 71414ef9c9c383c356615302875a90beca9db4ce Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Sun, 30 Nov 2025 00:25:30 -0800 Subject: [PATCH] chore: better logs --- joint_teapot/app.py | 4 ++-- joint_teapot/workers/git.py | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/joint_teapot/app.py b/joint_teapot/app.py index 4174713..ca34ccf 100644 --- a/joint_teapot/app.py +++ b/joint_teapot/app.py @@ -389,12 +389,12 @@ def joj3_all_env( lock_file_path = os.path.join( settings.repos_dir, grading_repo_name, settings.joj3_lock_file_path ) - logger.info( + logger.debug( f"try to acquire lock, file path: {lock_file_path}, " + f"timeout: {settings.joj3_lock_file_timeout}" ) with FileLock(lock_file_path, timeout=settings.joj3_lock_file_timeout).acquire(): - logger.info("file lock acquired") + logger.debug("file lock acquired") retry_interval = 1 git_push_ok = False while not git_push_ok: diff --git a/joint_teapot/workers/git.py b/joint_teapot/workers/git.py index 53a583a..8461056 100644 --- a/joint_teapot/workers/git.py +++ b/joint_teapot/workers/git.py @@ -105,8 +105,8 @@ class Git: os.remove(lock_file_path) locks_removed_count += 1 except OSError as e: - logger.warning(f"Error removing lock file: {e}") - logger.info(f"Removed {locks_removed_count} lock files") + logger.warning(f"error removing lock file: {e}") + logger.info(f"removed {locks_removed_count} lock files") repo.git.fetch("--tags", "--all", "-f") repo.git.reset("--hard", reset_target) repo.git.clean("-d", "-f", "-x") @@ -143,9 +143,7 @@ class Git: try: repo.index.add(file) except OSError: - logger.warning( - f'File path "{file}" does not exist. Skipping this file.' - ) + logger.warning(f'file path "{file}" does not exist, skipped') continue if repo.is_dirty(untracked_files=True) or repo.index.diff(None): repo.index.commit(commit_message)