LogMessage API Reference¶
Parameters¶
message¶
Type:
stringDefault: REQUIRED
Description: The message to log.
Example:
Hello, World!
Attributes¶
time_ns¶
Type:
integerDescription: The time the LogMessage was created in nanoseconds.
Example:
1617225013000000000
unix¶
Type:
integerDescription: The unix timestamp that the LogMessage was created, in milliseconds.
Example:
1617225013000
uuid¶
Deprecated! Will be removed in 4.0.0, if you need a unique identifier for the LogNode, use python’s built-in
id()function or assign your own unique identifier to the LogNode using a custom attribute.Type:
stringDescription: The unique identifier for the LogMessage.
Example:
1729141302148986000-187
message¶
Type:
stringDescription: The message that was logged, in plain text.
Example:
Hello, World!
level¶
Type:
stringDescription: The level of the log message.
Example:
INFO,ERROR,WARN,DEBUG
color¶
Type:
stringDescription: The ANSI color code for the level of the log message.
Example:
\033[1;32m
exception¶
Type:
Exception,NoneDescription: The original Python exception object. Only present (non-
None) if the LogMessage is aPythonExceptionMessage. For all other LogMessage subclasses, this isNone.
formatted¶
Type:
stringDescription: The message as a string with its timestamp, level, and ANSI color codes. (identical to
colored()) This is the recommended way to get a formatted string representation of the LogMessage.Example:
\x1b[92m[2026-03-20 00:24:00.261] INFO: Test!\x1b[0mNote: Identical to
colored(), but as a property instead of a method.colored()is deprecated and will be removed in 4.0.0.
Methods¶
colored¶
Deprecated! Use the
formattedproperty instead.Description: Returns the message with its timestamp, level, and ANSI color codes as a string. Identical to
formatted.Returns:
string
Dunders¶
__str__Description: Returns the message as a string (without ANSI color coding)
Returns:
string
__repr__Description: Nearly identical to
__str__but does not include the timestamp.Returns:
string
__eq__Description: Compares the
uuidof two LogMessages, if they are the same, returnsTrue, otherwiseFalse.Returns:
bool
__ne__Description: Compares the
uuidof two LogMessages, if they are different, returnsTrue, otherwiseFalse.Returns:
bool