Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to suppress INFO messages #1486

Closed
microprediction opened this issue Mar 3, 2023 · 2 comments
Closed

How to suppress INFO messages #1486

microprediction opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@microprediction
Copy link

Nothing seems to work getting rid of the managed_loop messages!

      from logging import CRITICAL
      from ax.utils.common.logger import get_logger
      rt = get_logger('ax')
      rt.setLevel(CRITICAL)
      import warnings
      warnings.filterwarnings("ignore")
      import logging
      logging.basicConfig(level=logging.WARNING)
      import logging
  
  
      class SuppressInfoFilter(logging.Filter):
          def filter(self, record):
              return "ax.service.managed_loop:" not in record.getMessage()
  

      # Create a custom logger with the suppress info filter??
      logger = logging.getLogger()
      logger.setLevel(logging.INFO)
      handler = logging.StreamHandler()
      handler.addFilter(SuppressInfoFilter())
      logger.addHandler(handler)
@mpolson64
Copy link
Contributor

Hi @microprediction , sorry this has been confusing -- we could definitely do to document this better. To set the suppress these logs you need to interact with our root stream handler like this:

import logging
from ax.utils.common.logger import ROOT_STREAM_HANDLER
ROOT_STREAM_HANDLER.setLevel(logging.WARNING)

Let me know if that works for you, and feel free to open a new issue if you have any more questions. Thank you for using Ax.

@lena-kashtelyan lena-kashtelyan added the question Further information is requested label Mar 21, 2023
@lena-kashtelyan
Copy link
Contributor

Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants