Use logger for setup with default level INFO#233
Merged
Conversation
|
Job PR-233-79bfac1 is done. |
shchur
reviewed
May 29, 2026
Comment on lines
+102
to
+115
| # Silence the python-API's INFO logs so they don't fight the spinner; warnings still surface. | ||
| cloud_logger = logging.getLogger("autogluon.cloud") | ||
| prior_level = cloud_logger.level | ||
| cloud_logger.setLevel(logging.WARNING) | ||
| try: | ||
| with _console.status(f"Deploying stack '{effective_stack}'...", spinner="dots"): | ||
| _abort_on_error( | ||
| _bootstrap, | ||
| backend=backend, | ||
| stack_name=effective_stack, | ||
| session=session, | ||
| ) | ||
| finally: | ||
| cloud_logger.setLevel(prior_level) |
Collaborator
There was a problem hiding this comment.
Minor: maybe move this to a helper on top? smth like
from contextlib import contextmanager
@contextmanager
def _quiet_logger(name: str, level: int = logging.WARNING):
"""Temporarily raise a logger's level so its INFO output doesn't fight the rich spinner."""
logger = logging.getLogger(name)
prior = lg.level
lg.setLevel(level)
try:
yield
finally:
logger.setLevel(prior)and then the caller becomes simply
with _quiet_logger("autogluon.cloud"), _console.status(f"Deploying stack '{effective_stack}'...", spinner="dots"):
_abort_on_error(_bootstrap, backend=backend, stack_name=effective_stack, session=session)
Collaborator
Author
There was a problem hiding this comment.
yeah this looks cleaner, updating
shchur
approved these changes
May 29, 2026
Collaborator
shchur
left a comment
There was a problem hiding this comment.
Thanks! One optional suggestion only
9b92a15 to
11a6fbe
Compare
|
Job PR-233-9b92a15 is done. |
|
Job PR-233-11a6fbe is done. |
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.
Description of changes:
Replaced prints with INFO level logger.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.