pyprep.set_log_level#
- pyprep.set_log_level(level, return_old_level=False)[source]#
Change the level of the
pypreplogger, leaving its handlers alone.Use this rather than
pyprep.setup_logging()to turn the package up or down:pyprep.setup_logging()also decides where the records go, so calling it again just to change the level would reset the stream, the format, and the propagation that an application had chosen.- Parameters:
- level
int|str Level for the
pypreplogger, either a name (e.g."debug","WARNING") or a stdlib constant such aslogging.DEBUG. Names are case-insensitive, as inmne.set_log_level().- return_old_levelbool
Whether to return the level the logger had before this call, so that a caller can put it back afterwards. Defaults to
False.
- level
- Returns:
Notes
This cannot make records appear on its own. Until
pyprep.setup_logging()has run, or the application has configured a logger that this one propagates to, there is no handler to write them.