logging#

This provides logging functionality for MESA.

It is modeled on the default logging approach that comes with Python.

function_logger(name)[source]#

Decorator for adding logging to a Function.

Parameters:

name (str) – The name of the module in which the function being decorated is located

get_module_logger(name: str)[source]#

Helper function for getting the module logger.

Parameters:

name (str) – The name of the module in which the method being decorated is located

get_rootlogger()[source]#

Returns root logger used by MESA.

Returns:

the root logger of MESA

log_to_stderr(level: int | None = None, pass_root_logger_level: bool = False)[source]#

Turn on logging and add a handler which prints to stderr.

Parameters:
  • level – minimum level of the messages that will be logged

  • pass_root_logger_level – bool, optional. Default False if True, all module loggers will be set to the same logging level as the root logger.

method_logger(name: str)[source]#

Decorator for adding logging to a method.

Parameters:

name (str) – The name of the module in which the method being decorated is located