benchmarkstt.normalization.logger module

%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#e7f2fa', 'lineColor': '#2980B9' }}}%% classDiagram DiffLoggingFormatter Logger ListHandler LogCapturer DiffLoggingDictFormatterDialect DiffLoggingFormatterDialect DiffLoggingTextFormatterDialect StreamHandler <|-- ListHandler DiffLoggingFormatterDialect <|-- DiffLoggingTextFormatterDialect DiffLoggingFormatterDialect <|-- DiffLoggingDictFormatterDialect Formatter <|-- DiffLoggingFormatter class NormalizedLogItem { <<namedtuple>> stack original normalized } class Logger { } class ListHandler { +acquire() +addFilter(filter) +close() +createLock() +emit(record) +filter(record) +flush() +format(record) +get_name() +handle(record) +handleError(record) +release() +removeFilter(filter) +setFormatter(fmt) +setLevel(level) +setStream(stream) +set_name(name) } class DiffLoggingFormatterDialect { +format(title, stack, diff) } class DiffLoggingTextFormatterDialect { +format(title, stack, diff) } class DiffLoggingDictFormatterDialect { +format(title, stack, diff) } class DiffLoggingFormatter { +format(record) +formatException(ei) +formatMessage(record) +formatStack(stack_info) +formatTime(record, datefmt=None) +usesTime() dialect=None diff_formatter_dialect=None title=None *args **kwargs get_dialect(dialect, strict=None)$ has_dialect(dialect)$ } class LogCapturer { <<context>> *args **kwargs }
class benchmarkstt.normalization.logger.DiffLoggingDictFormatterDialect[source]

Bases: benchmarkstt.normalization.logger.DiffLoggingFormatterDialect

format(title, stack, diff)[source]
class benchmarkstt.normalization.logger.DiffLoggingFormatter(dialect=None, diff_formatter_dialect=None, title=None, *args, **kwargs)[source]

Bases: logging.Formatter

diff_logging_formatter_dialects = {'dict': <class 'benchmarkstt.normalization.logger.DiffLoggingDictFormatterDialect'>, 'text': <class 'benchmarkstt.normalization.logger.DiffLoggingTextFormatterDialect'>}
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.

classmethod get_dialect(dialect, strict=None)[source]
classmethod has_dialect(dialect)[source]
class benchmarkstt.normalization.logger.DiffLoggingFormatterDialect[source]

Bases: object

format(title, stack, diff)[source]
class benchmarkstt.normalization.logger.DiffLoggingTextFormatterDialect[source]

Bases: benchmarkstt.normalization.logger.DiffLoggingFormatterDialect

format(title, stack, diff)[source]
class benchmarkstt.normalization.logger.ListHandler[source]

Bases: logging.StreamHandler

emit(record)[source]

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an 'encoding' attribute, it is used to determine how to do the output to the stream.

flush()[source]

Flushes the stream.

property logs
class benchmarkstt.normalization.logger.LogCapturer(*args, **kwargs)[source]

Bases: object

property logs
class benchmarkstt.normalization.logger.Logger[source]

Bases: object

class benchmarkstt.normalization.logger.NormalizedLogItem(stack, original, normalized)

Bases: tuple

property normalized

Alias for field number 2

property original

Alias for field number 1

property stack

Alias for field number 0

benchmarkstt.normalization.logger.log(func)[source]

Log decorator for normalization classes