loris_log.customLog

The CustomLogMessage that contains the custom log message

class CustomLog:

Class to construct the log message (info, error, debug, fatal, log data).

@staticmethod
def set_error_message(uu_id, name, message):

Set up the format of the error message.

Args:

uu_id (string): The generated uuid.
name (string): The name of the application or API.
message (array): The error message.

Returns:

string: The custom error message.

Raises NoneValueException:

If the uu_id, name or message of a None.

Raises EmptyParameterException:

If the uu_id is not of length 36, or name is
or the message is empty.

Raises InvalidAttributeException:

If the uu_id is not of type uuid, name is not of type string,
and message is not of type list.

Raises InvalidMessageException:

if the error message creation is a failure.
@staticmethod
def set_debug_message(uu_id, name, message):

Set up the format of the debug message

Args:

uu_id (string): The generated uuid.
name (string): The name of the application/ API/ function/ feature.
message (list): The error message.

Returns:

string: The custom debug message.

Raises NoneValueException:

If the uu_id, name or message is a none value.

Raises EmptyParameterException:

If the uu_id is not of length 36 or the name 
or the message is empty.

Raises InvalidAttributeException:

If the uu_id is not of type uuid, name is not
of type string, and message is not of type list.

Raises InvalidMessageException:

If the log creation failed.
@staticmethod
def set_fatal_message(uu_id, name, message):

Set up the format of the fatal message.

Args:

uu_id (string): The generated uuid.
name (string): The name of the application/api/function/feature.
message (list): The error message.

Returns:

string: The custom fatal message.

Raises NoneValueException:

If the uu_id, name or message is a none value.

Raises EmptyParameterException:

If the uu_id is not of length 36 or the name 
or the message is empty.

Raises InvalidAttributeException:

If the uu_id is not of type uuid, name is not
of type string, and message is not of type list.

Raises InvalidMessageException:

If the log creation failed.
@staticmethod
def set_info_message(uu_id, name, message):

Set up the format of the info message.

Args:

uu_id (string): The generated uuid.
name (string): The name of the application or API
message (list): The error message.

Returns:

string: The custom info message.

Raises NoneValueException:

If the uu_id, name or message is a none value.

Raises EmptyParameterException:

If the uu_id is not of length 36 or the name 
or the message is empty.

Raises InvalidAttributeException:

If the uu_id is not of type uuid, name is not
of type string, and message is not of type list.

Raises InvalidMessageException:

If the log creation failed.
@staticmethod
def set_sensor_info_message(sensor_id, name, message):

Set up the info log message for the sensors.

Args:

sensor_id (str): The sensor id.
name (string): The name of application/ service/ or remote request IP address.
message (list): The content of message.

Raises NoneValueException:

If the sensor_id, name, or message is of none value.

Raises EmptyParameterException:

If the sensor_id, name or message is empty.

Raises InvalidAttributeException:

If the sensor_id and name is not of type string, or
message is not of type list.

Raises InvalidMessageException:

If there is an issue is creating the custom info message
for a sensor.

Returns:

string: The sensor info log message.
@staticmethod
def set_sensor_debug_message(sensor_id, name, message):

Set the debug log message for an sensor.

Args:

sensor_id (string): The sensor id.
name (string): The name of the API/ application/ service or remote 
                request IP address.
message (string): The log message.

Raises NoneValueException:

If the sensor_id, name and message is of type none.

Raises EmptyParameterException:

If the sensor_id, name and message is an empty value.

Raises InvalidAttributeException:

If the sensor_id and name is not type string, and 
message is not of type list.

Raises InvalidMessageException:

If the creating the debug log_message is failed.

Returns:

string: The debug log message.
@staticmethod
def set_sensor_error_message(sensor_id, name, message):

The set up of the error message for the sensor.

Args: sensor_id (string ): The sensor id. name (string): The name of application/ API/ request remote IP. message (list): The error log message.

Raises NoneValueException:

If the sensor_id, name, or message is of none value.

Raises EmptyParameterException:

If the sensor_id, name and message is empty.

Raises InvalidAttributeException:

If the sensor_id and name is not of type string, while
message is not of type list.

Raises InvalidMessageException:

If the operation to create the error log message is a
failure.

Returns: string: The sensor error message.

@staticmethod
def set_sensor_fatal_message(sensor_id, name, message):

Set up the fatal log message for a sensor.

Args:

sensor_id (string): The sensor id.
name (string): The name of application/ API or remote request IP.
message (list): The fatal log message

Raises NoneValueException:

If the sensor_id, name or message is a none value.

Raises EmptyParameterException:

If the sensor_id, name or message is empty.

Raises InvalidAttributeException:

If the sensor_id and name is not of type string, or 
the message is not a list.

Raises InvalidMessageException:

If the operation to create the fatal log message is a 
failure.

Returns: string: the fatal log message.

@staticmethod
def set_ftp_log_data(uu_id, starttime, endtime, result, groundtruth):

Set up the log message for the FTP system.

Args:

uuid (string): The generated uuid.
starttime (string): the start time of an operation.
endtime (string): the end time of an operation.
result (string): the result of the embedded device/ system/ model etc.
groundtruth (string): the result of the embedded device/ system/ model etc.

Returns:

string: a list of log data.

Raises NoneValueException:

If the uu_id, name or message is a none value.

Raises EmptyParameterException:

If the uu_id is not of length 36 or the name 
is empty.

Raises InvalidAttributeException:

If the uu_id is not of type uuid, name is not
of type string, and message is not of type list.

Raises InvalidMessageException:

If the log creation failed.