module documentation

Code and data structures for storing and displaying errors.

Class CheckPoint Represents a position in an error log.
Class Error Representation of an error in the error log.
Class ErrorLog ErrorLog with convenience functions.
Class ErrorLogBase A stream of errors.
Function get_error_names_set Undocumented
Constant MAX_TRACEBACK_LENGTH Undocumented
Constant MAX_TRACEBACKS Undocumented
Constant SEVERITY_ERROR Undocumented
Constant SEVERITY_WARNING Undocumented
Constant TRACEBACK_MARKER Undocumented
Function _compare_traceback_strings Try to compare two traceback strings.
Function _dedup_opcodes Dedup the opcodes in a stack of frames.
Function _error_name Decorate a function so that it binds the current error name.
Function _function_name Undocumented
Function _make_traceback_str Turn a stack of frames into a traceback string.
Function _maybe_truncate_traceback Truncate the traceback if it is too long.
Constant _COLOR_ERROR_NAME_TEMPLATE Undocumented
Constant _CURRENT_ERROR_NAME Undocumented
Constant _ELLIPSIS Undocumented
Constant _ERROR_NAMES Undocumented
Constant _FORE_RED Undocumented
Constant _FORE_RESET Undocumented
Constant _STYLE_BRIGHT Undocumented
Constant _STYLE_RESET_ALL Undocumented
Type Variable _FuncT Undocumented
Variable _log Undocumented
def get_error_names_set(): (source)

Undocumented

MAX_TRACEBACK_LENGTH: int = (source)

Undocumented

Value
3
MAX_TRACEBACKS: int = (source)

Undocumented

Value
3
SEVERITY_ERROR: int = (source)

Undocumented

Value
2
SEVERITY_WARNING: int = (source)

Undocumented

Value
1
TRACEBACK_MARKER: str = (source)

Undocumented

Value
'Called from (traceback):'
def _compare_traceback_strings(left, right): (source)

Try to compare two traceback strings. Two traceback strings are comparable if they are equal, or if one ends with the other. For example, these two tracebacks are comparable: Traceback: line 1, in <module> line 2, in foo Traceback: line 2, in foo and the first is greater than the second. Args: left: A string or None. right: A string or None. Returns: None if the inputs aren't comparable, else an integer.

def _dedup_opcodes(stack): (source)

Dedup the opcodes in a stack of frames.

def _error_name(name) -> Callable[[_FuncT], _FuncT]: (source)

Decorate a function so that it binds the current error name.

def _function_name(name, capitalize=False): (source)

Undocumented

def _make_traceback_str(frames): (source)

Turn a stack of frames into a traceback string.

def _maybe_truncate_traceback(traceback): (source)

Truncate the traceback if it is too long. Args: traceback: A list representing an error's traceback. There should be one list item per entry in the traceback (in the right order); beyond that, this function does not care about the item types. Returns: The traceback, possibly with some items removed and an _ELLIPSIS inserted. Guaranteed to be no longer than MAX_TRACEBACK_LENGTH.

_COLOR_ERROR_NAME_TEMPLATE = (source)

Undocumented

Value
(((_STYLE_BRIGHT+_FORE_RED)+'%s')+_FORE_RESET)+_STYLE_RESET_ALL
_CURRENT_ERROR_NAME = (source)

Undocumented

Value
utils.DynamicVar()
_ELLIPSIS = (source)

Undocumented

Value
object()
_ERROR_NAMES = (source)

Undocumented

Value
set()
_FORE_RED: str = (source)

Undocumented

Value
'\x1b[31m'
_FORE_RESET: str = (source)

Undocumented

Value
'\x1b[39m'
_STYLE_BRIGHT: str = (source)

Undocumented

Value
'\x1b[1m'
_STYLE_RESET_ALL: str = (source)

Undocumented

Value
'\x1b[0m'

Undocumented

Value
TypeVar('_FuncT',
        bound=Callable)

Undocumented