Skip to content

formatter.term_escape_code

Classes:

Name Description
TermEscapeCodeFormatter

A class to strip the escape codes from the message.

Classes

TermEscapeCodeFormatter

Bases: Formatter


              flowchart TD
              formatter.term_escape_code.TermEscapeCodeFormatter[TermEscapeCodeFormatter]

              

              click formatter.term_escape_code.TermEscapeCodeFormatter href "" "formatter.term_escape_code.TermEscapeCodeFormatter"
            

A class to strip the escape codes from the message.

Methods:

Name Description
formatMessage

Format message and strip the escape codes.

Source code in dlr/ki/logging/formatter/term_escape_code.py
class TermEscapeCodeFormatter(Formatter):
    """
    A class to strip the escape codes from the message.
    """

    def formatMessage(self, record):
        """
        Format message and strip the escape codes.

        Args:
            record: message record to be formatted

        Returns:
            str: formatted message
        """
        msg = super().formatMessage(record)
        return non_ansi(msg)

Functions

formatMessage
formatMessage(record)

Format message and strip the escape codes.

Parameters:

Name Type Description Default
record

message record to be formatted

required

Returns:

Name Type Description
str

formatted message

Source code in dlr/ki/logging/formatter/term_escape_code.py
def formatMessage(self, record):
    """
    Format message and strip the escape codes.

    Args:
        record: message record to be formatted

    Returns:
        str: formatted message
    """
    msg = super().formatMessage(record)
    return non_ansi(msg)