Skip to content

aea.helpers.logging

Logging helpers.

get_logger

get_logger(module_path: str, agent_name: str) -> Logger

Get the logger based on a module path and agent name.

AgentLoggerAdapter Objects

class AgentLoggerAdapter(LoggerAdapter)

This class is a logger adapter that prepends the agent name to log messages.

__init__

 | __init__(logger: Logger, agent_name: str)

Initialize the logger adapter.

Arguments:

  • agent_name: the agent name.

process

 | process(msg: Any, kwargs: MutableMapping[str, Any]) -> Tuple[Any, MutableMapping[str, Any]]

Prepend the agent name to every log message.

WithLogger Objects

class WithLogger()

Interface to endow subclasses with a logger.

__init__

 | __init__(logger: Optional[Logger] = None, default_logger_name: str = "aea")

Initialize the logger.

Arguments:

  • logger: the logger object.
  • default_logger_name: the default logger name, if a logger is not provided.

logger

 | @property
 | logger() -> Logger

Get the component logger.

logger

 | @logger.setter
 | logger(logger: Optional[Logger])

Set the logger.