Coretex
coretex.logging.log.Log Class Reference
Inheritance diagram for coretex.logging.log.Log:
coretex.codable.codable.Codable

Public Member Functions

Self create (cls, str message, LogSeverity severity)
 
- Public Member Functions inherited from coretex.codable.codable.Codable
Dict[str, Any] encode (self)
 
None onDecode (self)
 
Self decode (cls, Dict[str, Any] encodedObject)
 

Detailed Description

    Represents a single Coretex console log

    timestamps : float
        timestamp of the log
    message : str
        message of the log
    severity : LogSeverity
        severity of the log

Definition at line 29 of file log.py.

Member Function Documentation

◆ create()

Self coretex.logging.log.Log.create (   cls,
str  message,
LogSeverity  severity 
)
    Creates a new Log object with the current timestamp

    Parameters
    ----------
    message : str
message of the log
    severity : LogSeverity
severity of the log

    Returns
    -------
    Self -> Log object

Definition at line 62 of file log.py.

62  def create(cls, message: str, severity: LogSeverity) -> Self:
63  """
64  Creates a new Log object with the current timestamp
65 
66  Parameters
67  ----------
68  message : str
69  message of the log
70  severity : LogSeverity
71  severity of the log
72 
73  Returns
74  -------
75  Self -> Log object
76  """
77 
78  log = cls()
79 
80  log.timestamp = mathematicalRound(time.time(), 6)
81  log.message = Log.__createMessage(message, severity)
82  log.severity = severity
83 
84  return log
85 

The documentation for this class was generated from the following file: