Logging - tmuxp.log

Log utilities for tmuxp.

tmuxp.log.setup_logger(logger=None, level='INFO')[source]

Configure tmuxp’s logging for CLI use.

Can checks for any existing loggers to prevent loading handlers twice.

Return type:

None

Parameters:

logger (Logger) – logger instance for tmuxp

tmuxp.log.set_style(message, stylized, style_before='', style_after='', prefix='', suffix='')[source]

Stylize terminal logging output.

Return type:

str

class tmuxp.log.LogFormatter(color=True, **kwargs)[source]

Bases: Formatter

Format logs for tmuxp.

template(record, stylized=False, **kwargs)[source]

Return the prefix for the log message. Template for Formatter.

Return type:

str

:param logging.LogRecord: object. this is passed in from inside the

logging.Formatter.format() record.

Returns:

template for logger message

Return type:

str

format(record)[source]

Format a log record.

Return type:

str

tmuxp.log.debug_log_template(self, record, stylized=False, **kwargs)[source]

Return the prefix for the log message. Template for Formatter.

Return type:

str

Parameters:

record (logging.LogRecord) – This is passed in from inside the logging.Formatter.format() record.

Returns:

Log template.

Return type:

str

class tmuxp.log.DebugLogFormatter(color=True, **kwargs)[source]

Bases: LogFormatter

Provides greater technical details than standard log Formatter.

template(record, stylized=False, **kwargs)[source]

Return the prefix for the log message. Template for Formatter.

Return type:

str

Parameters:

record (logging.LogRecord) – This is passed in from inside the logging.Formatter.format() record.

Returns:

Log template.

Return type:

str