logging.setLogRecordFactory(factory)
Set a callable which is used to create a LogRecord.
Parameters:
factory – The factory callable to be used to instantiate a log record.
New in version 3.2: This function has been provided, along with getLogRecordFactory(), to allow developers more control over how the LogRecord representing a logging event is constructed.
The factory has the following signature:
factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, **kwargs)
name: