Skip to content

Conversation

@S1M0N38
Copy link
Collaborator

@S1M0N38 S1M0N38 commented Jul 15, 2025

No description provided.

S1M0N38 and others added 5 commits July 15, 2025 13:56
- Remove empty line from index.md
- Remove index.md from mkdocs.yml sections list
Rename function parameter from 'params' to 'arguments' across Lua logging
system and test files to improve code consistency and clarity.

Co-Authored-By: Claude <noreply@anthropic.com>
- Add logging import and logger initialization
- Log connection attempts and successful connections
- Log API request names and completion status
- Log errors for connection failures and API errors
- Log disconnection events

Co-Authored-By: Claude <noreply@anthropic.com>
- Add logging-systems.md covering JSONL run logging, Python SDK logging, and mod logging
- Document JSONL format specification for run replay functionality
- Include Python SDK logging configuration examples
- Add logging systems page to mkdocs navigation

Co-Authored-By: Claude <noreply@anthropic.com>
@S1M0N38 S1M0N38 requested a review from Copilot July 15, 2025 13:20
@S1M0N38 S1M0N38 self-assigned this Jul 15, 2025
@S1M0N38 S1M0N38 marked this pull request as ready for review July 15, 2025 13:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a unified logging system across Lua hooks and the Python SDK, renaming the JSONL key from params to arguments and documenting the new behavior.

  • Rename all occurrences of params to arguments in JSONL logs, Lua type annotations, log hook implementations, and tests.
  • Introduce Python SDK logging (using the logging module) in BalatroClient to log connections, API requests, and errors.
  • Add docs/logging-systems.md and update mkdocs.yml navigation to document the three logging systems.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/runs/one_ante_no_shop_2.jsonl Updated JSONL entries to use "arguments" instead of "params".
tests/runs/one_ante_no_shop_1.jsonl Same key rename for JSONL entries.
tests/lua/test_runs.py Updated test logic to reference function_call["arguments"].
src/lua/types.lua Updated LuaDoc annotation for LogEntry to use arguments.
src/lua/log.lua Renamed hook parameter variables and JSON field from params to arguments.
src/balatrobot/client.py Imported logging, instantiated a logger, and added log statements around connect, request, and error handling.
mkdocs.yml Added logging-systems.md to the site nav; removed an outdated index.md entry in the plugin section.
docs/logging-systems.md New documentation page describing the three logging systems.
docs/index.md Cleaned up stray markdown formatting.
.claude/settings.json Locked down editing of CHANGELOG.md.
Comments suppressed due to low confidence (3)

src/lua/types.lua:125

  • Remove the outdated commented annotation for params since the type now uses arguments, avoiding confusion in LuaDoc.
---@field timestamp_ms number Timestamp in milliseconds since epoch

mkdocs.yml:41

  • The plugin's Documentation section removed index.md but hasn't been updated to include the new logging-systems.md; ensure the plugin configuration lists the new file so it's surfaced.
        Documentation:

src/balatrobot/client.py:22

  • No tests currently verify that the new logger emits the expected messages; consider adding unit tests (e.g., with pytest's caplog) to exercise connection and API request logs.
logger = logging.getLogger(__name__)


# Create and validate request
request = APIRequest(name=name, arguments=arguments)
logger.info(f"Sending API request: {name}")
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider lowering this to a debug-level log (logger.debug) for routine API messages so INFO-level remains focused on higher-priority events.

Suggested change
logger.info(f"Sending API request: {name}")
logger.debug(f"Sending API request: {name}")

Copilot uses AI. Check for mistakes.
logger.error(f"API request {name} failed: {response_data.get('error')}")
raise create_exception_from_error_response(response_data)

logger.info(f"API request {name} completed successfully")
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Similarly, you may want to use a debug-level log here to reduce noise in INFO-level logs during normal operation.

Suggested change
logger.info(f"API request {name} completed successfully")
logger.debug(f"API request {name} completed successfully")

Copilot uses AI. Check for mistakes.
Changes log level from info to debug for API request start and completion
messages to reduce noise in standard output while maintaining detailed
debugging capability.

Co-Authored-By: Claude <noreply@anthropic.com>
@S1M0N38 S1M0N38 merged commit c1bda08 into main Jul 15, 2025
7 checks passed
@S1M0N38 S1M0N38 deleted the dev branch July 15, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant