pytc.LevelIndentFormatter

class pytc.LevelIndentFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

Formatter that indents DEBUG messages by two spaces.

Methods

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__

Return self==value.

__format__

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize the formatter with specified format strings.

__init_subclass__

This method is called when a class is subclassed.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.

__new__

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__

Size of object in memory, in bytes.

__str__

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

converter

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

format

Format the specified record as text.

formatException

Format and return the specified exception information as a string.

formatMessage

formatStack

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

formatTime

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

usesTime

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

Attributes

DEBUG_INDENT

__annotations__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

default_msec_format

default_time_format

DEBUG_INDENT = '  '
format(record)[source]

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.