API Reference
dttb
DateTime TraceBack
Callback = Callable[[CallbackArgs], Any]
module-attribute
CallbackArgs
Bases: NamedTuple
Arguments passed to the callback function when an uncaught exception occurs.
Attributes:
| Name | Type | Description |
|---|---|---|
now |
datetime
|
The timestamp when the exception was caught. |
exc_type |
Type[BaseException]
|
The type of the exception. |
exc_value |
Optional[BaseException]
|
The exception instance, or |
exc_traceback |
Optional[TracebackType]
|
The traceback object, or |
thread |
Optional[Thread]
|
The thread in which the exception occurred, or |
Source code in src/dttb/__init__.py
apply(*, tz=None, callback=None)
Applies attaching datetime to exception traceback.
This also supports logging and threading if involved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tz
|
Optional[tzinfo]
|
An optional |
None
|
callback
|
Optional[Callback]
|
An optional |
None
|