Conversation
🧪 Code Coverage (vs
|
There was a problem hiding this comment.
Code Review
This pull request introduces configurable logging levels and debug log persistence for the ITK service. Key changes include updating the .gitignore to exclude log files, documenting the new debugging workflow in the README.md, and modifying main.py and run_itk.sh to respect the ITK_LOG_LEVEL environment variable. In DEBUG mode, a local logs/ directory is created and mounted to the container. Review feedback suggests optimizing main.py by reusing the global log level variable and improving the readability of run_itk.sh by merging redundant conditional blocks.
| grpc_port, | ||
| ) | ||
|
|
||
| uvicorn_log_level = os.environ.get('ITK_LOG_LEVEL', 'INFO').lower() |
There was a problem hiding this comment.
The environment variable ITK_LOG_LEVEL is already fetched and stored in the global variable log_level at the top of the module. You can reuse it here to avoid redundant lookups.
| uvicorn_log_level = os.environ.get('ITK_LOG_LEVEL', 'INFO').lower() | |
| uvicorn_log_level = log_level.lower() |
| if [ "${ITK_LOG_LEVEL^^}" = "DEBUG" ]; then | ||
| mkdir -p "$ITK_DIR/logs" | ||
| fi | ||
|
|
||
| DOCKER_MOUNT_LOGS="" | ||
| if [ "${ITK_LOG_LEVEL^^}" = "DEBUG" ]; then | ||
| DOCKER_MOUNT_LOGS="-v $ITK_DIR/logs:/app/logs" | ||
| fi |
There was a problem hiding this comment.
These two conditional blocks check the same condition (ITK_LOG_LEVEL being DEBUG). They can be merged for better readability and to avoid redundant checks.
| if [ "${ITK_LOG_LEVEL^^}" = "DEBUG" ]; then | |
| mkdir -p "$ITK_DIR/logs" | |
| fi | |
| DOCKER_MOUNT_LOGS="" | |
| if [ "${ITK_LOG_LEVEL^^}" = "DEBUG" ]; then | |
| DOCKER_MOUNT_LOGS="-v $ITK_DIR/logs:/app/logs" | |
| fi | |
| DOCKER_MOUNT_LOGS="" | |
| if [ "${ITK_LOG_LEVEL^^}" = "DEBUG" ]; then | |
| mkdir -p "$ITK_DIR/logs" | |
| DOCKER_MOUNT_LOGS="-v $ITK_DIR/logs:/app/logs" | |
| fi |
Description
New version of itk https://github.com/a2aproject/a2a-samples/releases/tag/itk-v.015-alpha improves log readabiulity for debugging by spliting the logs of individual tested agents into separate files if the
ITK_LOG_LEVELenvironmental variable is set to "DEBUG"This PR integrates the change into python's sdk CI and updates the instruction on how to set debugging mode for tests
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)Fixes #<issue_number_goes_here> 🦕