Skip to content

Message Processing

Text processing, markup, and visual enhancements.


MessageProcessor

Python
MessageProcessor(color_service, markup_processor)

Processes log messages - formatting, headers, data markers, etc.

create_header

Python
create_header(text: str, level: logLevels = 'HEADER', size: int = None, compact: bool = False) -> Optional[str]

Create a formatted header.

process_log_message

Python
process_log_message(level: LogLevel, args: tuple, config_state, header: Optional[str] = None, no_color: bool = False) -> tuple

Process a log message with all formatting, markup, and special handling. Returns (processed_message, exc_info)

MarkupProcessor

Python
MarkupProcessor(color_service)

Handles all markup and highlighting logic.

process_message_markup

Python
process_message_markup(msg: str, config_state: LoggerConfigState, no_color: bool = False) -> str

Apply markup to message based on configuration.

highlight_literals

Python
highlight_literals(msg: str, preset: ColorPresets) -> str

highlight_data

Python
highlight_data(msg: str, preset: ColorPresets) -> str

add_data_markers

Python
add_data_markers(msg: str, preset: ColorPresets, level: LogLevel, head=False) -> str