ess.logging.Formatter

ess.logging.Formatter

class ess.logging.Formatter(show_thread, show_process)

Logging formatter that indents messages and optionally shows threading information.

Parameters
  • show_thread (bool) –

  • show_process (bool) –

__init__(show_thread, show_process)

Initialize the formatter.

The formatting is mostly fixed. Only printing of thread and processor names cna be toggled using the corresponding arguments. Times are always printed in ISO 8601 format.

Parameters
  • show_thread (bool) –

  • show_process (bool) –

Methods

__init__(show_thread, show_process)

Initialize the formatter.

converter

localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,

format(record)

Format the specified record as text.

formatException(ei)

Format and return the specified exception information as a string.

formatMessage(record)

formatStack(stack_info)

This method is provided as an extension point for specialized formatting of stack information.

formatTime(record[, datefmt])

Return the creation time of the specified LogRecord as formatted text.

usesTime()

Check if the format uses the creation time of the record.

Attributes

default_msec_format

default_time_format

format(record)

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

Parameters

record (logging.LogRecord) –

Return type

str