Logging functions#

rocketpy.utils.enable_logging(level='WARNING')[source]#

Enable RocketPy logging output to the console.

Attaches a StreamHandler to the rocketpy logger so that internal runtime events (simulation progress, warnings, errors) are printed to the terminal. Only RocketPy logs are affected — global/root logging is not modified. By default, only WARNING and above are shown.

Parameters:

level (str, optional) – The minimum logging level to display. Options are “DEBUG”, “INFO”, “WARNING”, “ERROR”, and “CRITICAL”. Default is “WARNING”.

Examples

Show only warnings and errors (default):

>>> import rocketpy
>>> rocketpy.utils.enable_logging()

Show all internal runtime messages, including simulation progress:

>>> import rocketpy
>>> rocketpy.utils.enable_logging(level="DEBUG")

Show confirmations like “Simulation completed” and “File saved”:

>>> import rocketpy
>>> rocketpy.utils.enable_logging(level="INFO")