pytc.LevelIndentFormatter¶
- class pytc.LevelIndentFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]¶
Bases:
FormatterFormatter 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().
converterlocaltime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
Format the specified record as text.
formatExceptionFormat and return the specified exception information as a string.
formatMessageformatStackThis method is provided as an extension point for specialized formatting of stack information.
formatTimeReturn the creation time of the specified LogRecord as formatted text.
usesTimeCheck if the format uses the creation time of the record.
Attributes
__annotations____dict____doc____module____weakref__list of weak references to the object
default_msec_formatdefault_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.