fix: replace print() with logger.warning() in new_workflow() and _register_with_scheduler()#235
Open
amathxbt wants to merge 1 commit intoOpenGradient:mainfrom
Open
Conversation
…ister_with_scheduler() Two diagnostic messages in alpha.py used print() instead of the logger that the rest of the SDK uses universally: 1. new_workflow() gas estimation fallback — printed to stdout, invisible to any logging handler the caller has configured. 2. _register_with_scheduler() failure — same issue; also loses the contract_address context that is now included in the log message. Replacing with logger.warning() makes these messages: - Suppressible via standard log-level configuration - Visible in log files, monitoring systems, and structured loggers - Consistent with every other diagnostic in the SDK
kylexqian
approved these changes
Apr 9, 2026
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.
Bug Fix: Replace
print()withlogger.warning()inalpha.py— diagnostic messages bypass logging configurationSummary
Two places in
alpha.pyuseprint()for diagnostic output instead of theloggerused everywhere else in the SDK. This means these messages bypass any log handler the user has configured and are completely invisible in non-interactive environments.Bug 1 —
new_workflow()gas estimation fallbackBug 2 —
_register_with_scheduler()failureWhy This Matters
print()logger.warning()Any user running the SDK as a service (Docker container, background process, anything with redirected stdout) would silently lose these warnings — including the critical gas estimation fallback message that tells them their transaction is using a 5M gas conservative limit instead of the estimated amount.
Affected Methods
Alpha.new_workflow()— gas estimation failure pathAlpha._register_with_scheduler()— scheduler registration failure path