flexget.log module#

class flexget.log.InterceptHandler(level=0)[source]#

Bases: Handler

Catch any stdlib log messages from our deps and propagate to loguru.

emit(record)[source]#

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

Parameters:

record (LogRecord)

flexget.log._log_filterer(record)[source]#

Add the function to our loguru handlers. It will dynamically use all filters we add later.

flexget.log.add_filter(func)[source]#

Add a filter function to the log handlers.

Parameters:

func (Callable[[loguru.Record], bool])

flexget.log.capture_logs(*args, **kwargs)[source]#

Take the same arguments as logger.add, but this sync will only log messages contained in context.

Return type:

Iterator

flexget.log.get_log_session_id()[source]#
Return type:

str

flexget.log.initialize(unit_test=False)[source]#

Prepare logging.

Parameters:

unit_test (bool)

Return type:

None

flexget.log.record_patcher(record)[source]#
Parameters:

record (loguru.Record)

Return type:

None

flexget.log.remove_filter(func)[source]#

Remove a filter function from the log handlers.

Parameters:

func (Callable[[loguru.Record], bool])

flexget.log.start(filename=None, level='INFO', to_console=True, to_file=True)[source]#

After initialization, start file logging.

Parameters:
Return type:

None