Event (autotransform.event.base)

The Event class represents an event happening in AutoTransform and serves as a base that can be used to provide consistent typing and messaging for similar events.

class autotransform.event.base.Event(data: TData)

Bases: Generic[TData], ABC

The base for Events. Used to construct a loggable event that can be hooked in to through the EventHandler to store logs in custom deployments.

data

The data that represents details of the Event.

Type

TData

create_time

The current timestamp when the event is created.

Type

float

create_time: float
data: TData
static get_color_override() Optional[str]

Used to override logging color for specific events where needed. Should use colorama ANSI codes.

Returns

An optional color to use to override defaults when logging.

Return type

Optional[str]

abstract static get_logging_level() LoggingLevel

The logging level for events of this type.

Returns

The logging detail required to log this event.

Return type

LoggingLevel

get_message() str

Gets a message that can be output to logs representing the event. Converts type from lowercase with underscores to capitalized words for the message.

Returns

The loggable message.

Return type

str

abstract static get_type() EventType

Used to represent the type of Event, output to logs.

Returns

The unique type associated with this Event.

Return type

EventType