Skip to main content

hackagent.logger

setup_package_logging

def setup_package_logging(
logger_name: str = "hackagent",
default_level_str: str = "WARNING") -> logging.Logger

Configures RichHandler for the specified logger if not already set.

suppress_noisy_libraries

def suppress_noisy_libraries(*names: str) -> None

Silence chatty third-party loggers to WARNING.

This is opt-in so that applications embedding hackagent are not surprised by their own library loggers being muted.

Example:

>>> from hackagent.logger import suppress_noisy_libraries >>> suppress_noisy_libraries("httpx", "litellm", "urllib3")

get_logger

def get_logger(name: str) -> logging.Logger

Retrieves a logger instance. If the logger is 'hackagent' or starts with 'hackagent.', it ensures the package logging is set up.