actio_python_utils.logging_functions.setup_logging¶
- actio_python_utils.logging_functions.setup_logging(logging_level='INFO', name='root', stream=None, stream_handler_logging_level=None, format_string='%(asctime)s - %(name)s - %(levelname)s - %(message)s', loggers_to_ignore=['parso.cache', 'parso.python.diff'])[source]¶
Set up the logger given by name, attach a stream handler, set the format, and log levels as specified. For logger names in
loggers_to_ignore, their levels are instead set tologging.CRITICAL- Parameters:
logging_level (
int|str, default:'INFO') – The logging level to usename (
str, default:'root') – The name of the logger to configurestream (
Optional[TextIOWrapper], default:None) – An optional output stream to log tostream_handler_logging_level (
Union[int,str,None], default:None) – The logging level to use for the handler; useslogging_levelif not specifiedformat_string (
str, default:'%(asctime)s - %(name)s - %(levelname)s - %(message)s') – How to format log messagesloggers_to_ignore (
Optional[list[str]], default:['parso.cache', 'parso.python.diff']) – A list of logger names for which to set their logging levels tologging.CRITICAL
- Return type:
None