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:
- 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:
- 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:
- :param
logging.LogRecord
: object. this is passed in from inside the logging.Formatter.format()
record.
- Returns:
template for logger message
- Return type:
- tmuxp.log.debug_log_template(self, record, stylized=False, **kwargs)[source]¶
Return the prefix for the log message. Template for Formatter.
- Return type:
- Parameters:
record (
logging.LogRecord
) – This is passed in from inside thelogging.Formatter.format()
record.- Returns:
Log template.
- Return type:
- 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:
- Parameters:
record (
logging.LogRecord
) – This is passed in from inside thelogging.Formatter.format()
record.- Returns:
Log template.
- Return type: