Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace ad-hoc
print()calls across the codebase with Python'sloggingmodule under a unifiedjudgearenalogger namespace. This gives users control over verbosity and enables persistent debug logs without code changes.I totally think this is required and its better to switch to using
loggingpackage than late as its common practice (also development friendly). The only concern is the log files. It is usually hard to read log directly from console so its better to save log in a rotation for debugging and results.Changes
New:
judgearena/log.pyget_logger(name)— returns a child logger under thejudgearenanamespace; auto-prefixes bare module names.configure_logging(verbosity, log_file)— sets up console + optional file handlers. SupportsJUDGEARENA_LOG_LEVELenv-var override.attach_file_handler(path)— adds a DEBUG-level file handler (always captures full trace regardless of console verbosity).make_run_log_path(folder)— generates a timestampedrun-YYYYMMDD_HHMMSS.logpath.New CLI flags (
judgearena/cli_common.py)-v/--verbose-q/--quiet--log-file PATH--no-log-filerun-*.login the result folderAdded
resolve_verbosity(args)helper —-qtakes precedence over-v.Codebase migration
Replaced
print()withlogger.info()/logger.debug()in:evaluate.py,generate_and_evaluate.py,estimate_elo_ratings.pyarenas_utils.py,eval_utils.py,utils.pyinstruction_dataset/__init__.py,mt_bench/mt_bench_utils.pyTests (
tests/test_logging.py)Behaviour
Default behaviour (
-v 0) matches existing output —INFOmessages print to stderr just like the oldprint()calls. No visible change for users who don't pass new flags.Example Log