File: //snap/core22/2111/lib/python3/dist-packages/cloudinit/reporting/__pycache__/events.cpython-310.pyc
o
x[h$ � @ s� d Z ddlZddlZddlZddlZddlmZ ddlm Z ddl
mZmZ ddl
mZ dZdZd Ze�e�ZG d
d� de�Zed�ZG d
d� d�ZG dd� de�Zddd�Zejdfdd�Zdd� ZG dd� d�Zdd� ZdS )z�
events for reporting.
The events here are designed to be used with reporting.
They can be published to registered handlers with report_event.
� N)�List)�performance)�available_handlers�instantiated_handler_registry)�ReportingHandler�finish�start� cloudinitc @ s e Zd Zdd� ZdS )�_namesetc C s || v r|S t d| ��)Nz%s not a valid value)�AttributeError)�self�name� r �</usr/lib/python3/dist-packages/cloudinit/reporting/events.py�__getattr__ s z_nameset.__getattr__N)�__name__�
__module__�__qualname__r r r r r r
s r
)�SUCCESS�WARN�FAILc @ s. e Zd ZdZedfdd�Zdd� Zdd� ZdS ) �ReportingEventz"Encapsulation of event formatting.Nc C s2 || _ || _|| _|| _|d u rt�� }|| _d S �N)�
event_typer
�description�origin�time� timestamp)r r r
r r r r r r �__init__, s
zReportingEvent.__init__c C s d� | j| j| j�S )z"The event represented as a string.z
{0}: {1}: {2})�formatr r
r �r r r r � as_string<