Skip to content

Reference

focalize.main

Focalize

focus
focus(focus_label: str, context_level: str = 'INFO')

Provides a context manager so that focus may be activated for a block of code

Parameters:

Name Type Description Default
focus_label str

An optional level describing the process contained within this context. This label will be printed at the beginning and end of each focused block

required
label_log_levell

The logging level at which to log the context lines (if not specified, defaults to self.info)

required

attach_focalize

attach_focalize(*logger_add_args, remove_other_handlers = True, local_timestamps = False, **logger_add_kwargs) -> Focalize

Attach the Focalize handler to the loguru logger.

Parameters:

Name Type Description Default
logger_add_args

Arguments to pass along to logger.add()

()
remove_other_handlers

If True, other handlers will be removed from the loguru logger

True
local_timestamps

If True, timestamps will be shown in the local timezone

False
logger_add_kwargs

Keyword arguments to pass along to logger.add()

{}