![]() |
NDEVR
API Documentation
|
A class that allows for specific log information to be conveyed to a InfoPipe object including information about severity and timestamp information. More...
Public Types | |
| enum | ApplicationMessagePriority : uint01 { e_success = 0 , e_debug = 1 , e_logged_debug = 2 , e_notification = 5 , e_warning = 50 , e_error = 150 , e_critical_error = 250 } |
| Defines severity levels for log messages, ranging from success to critical error. More... | |
Public Member Functions | |
| LogMessage () | |
| Constructs a default LogMessage with no content. | |
| LogMessage (const StringView &message, const uint01 error_level=e_notification) | |
| Constructs a LogMessage from a string view with an optional error level. | |
| LogMessage (const Time &time, const StringView &message, const uint01 error_level, uint02 session) | |
| Constructs a LogMessage with a specific time, message, error level, and session number. | |
| LogMessage (const Time &time, const StringView &message, const uint01 error_level=e_notification) | |
| Constructs a LogMessage with a specific time, message, and error level. | |
| LogMessage (const TranslatedString &message, const uint01 error_level=e_notification) | |
| Constructs a LogMessage from a translated string with an optional error level. | |
| Buffer< std::pair< String, String > > | ansiiEscapeBlocks () const |
| Parses the message into pairs of ANSI escape code sequences and their associated text. | |
| void | appendMessage (StringAllocatingView &message, bool include_new_lines, bool include_tabs, bool include_colors) const |
| Appends the formatted message to an existing string with optional formatting controls. | |
| bool | hasFormatting () const |
| Checks whether the message contains ANSI escape code formatting. | |
| bool | hasSubString (const StringView &s, bool ignore_case=false) const |
| Checks whether the message contains a given substring. | |
| bool | isFromCurrentSession () const |
| Checks whether this log message was generated during the current application session. | |
| bool | isSessionEnd () const |
| Checks whether this message is a session end marker. | |
| bool | isSessionStart () const |
| Checks whether this message is a session start marker. | |
| uint01 | logRecordLevel () const |
| Returns the severity level of this log message. | |
| StringAllocatingView | message (bool include_new_lines, bool include_tabs, bool include_colors) const |
| Returns the formatted message string with optional formatting controls. | |
| AlocatingAlignedBuffer< TextBlock, 64 > | messageBlocks (const Font &default_font) const |
| Converts the message into styled TextBlock objects using the specified default font. | |
| String & | rawMessage () |
| Returns a mutable reference to the raw, unformatted message string. | |
| const String & | rawMessage () const |
| Returns a const reference to the raw, unformatted message string. | |
| Time | recordTime () const |
| Returns the timestamp when this log message was recorded. | |
| uint02 | sessionNumber () const |
| Returns the session number that produced this log message. | |
| void | setErrorLevel (uint01 level) |
| Sets the severity level of this log message. | |
| void | setRecordTime (const Time &time) |
| Sets the timestamp of this log message. | |
| void | setSessionNumber (uint02 session) |
| Sets the session number that produced this log message. | |
Static Public Member Functions | |
| static uint02 | CurrentLogSession () |
| Returns the identifier for the current active log session. | |
| static constexpr StringView | LogSessionEnd () |
| Returns the sentinel string that marks the end of a log session. | |
| static constexpr StringView | LogSessionStart () |
| Returns the sentinel string that marks the start of a log session. | |
Protected Attributes | |
| uint01 | m_error_level |
| The severity level of this log message. | |
| String | m_message |
| The raw log message content. | |
| uint02 | m_session_number |
| The session number that produced this message. | |
| Time | m_time |
| The timestamp when the message was recorded. | |
A class that allows for specific log information to be conveyed to a InfoPipe object including information about severity and timestamp information.
Definition at line 47 of file LogMessage.h.
Defines severity levels for log messages, ranging from success to critical error.
Definition at line 53 of file LogMessage.h.
| LogMessage::LogMessage | ( | const Time & | time, |
| const StringView & | message, | ||
| const uint01 | error_level, | ||
| uint02 | session ) |
Constructs a LogMessage with a specific time, message, error level, and session number.
| [in] | time | The timestamp of the log entry. |
| [in] | message | The log message content. |
| [in] | error_level | The severity level of the message. |
| [in] | session | The session number that produced this message. |
References message().
| LogMessage::LogMessage | ( | const Time & | time, |
| const StringView & | message, | ||
| const uint01 | error_level = e_notification ) |
Constructs a LogMessage with a specific time, message, and error level.
| [in] | time | The timestamp of the log entry. |
| [in] | message | The log message content. |
| [in] | error_level | The severity level of the message. |
References e_notification, and message().
|
explicit |
Constructs a LogMessage from a string view with an optional error level.
| [in] | message | The log message content. |
| [in] | error_level | The severity level of the message. |
References e_notification, and message().
|
explicit |
Constructs a LogMessage from a translated string with an optional error level.
| [in] | message | The translated log message content. |
| [in] | error_level | The severity level of the message. |
References e_notification, and message().
Parses the message into pairs of ANSI escape code sequences and their associated text.
| void LogMessage::appendMessage | ( | StringAllocatingView & | message, |
| bool | include_new_lines, | ||
| bool | include_tabs, | ||
| bool | include_colors ) const |
Appends the formatted message to an existing string with optional formatting controls.
| [in] | message | The string to append the formatted message to. |
| [in] | include_new_lines | Whether to include newline characters in the output. |
| [in] | include_tabs | Whether to include tab characters in the output. |
| [in] | include_colors | Whether to include ANSI color escape codes in the output. |
References message().
|
static |
Returns the identifier for the current active log session.
| bool LogMessage::hasFormatting | ( | ) | const |
Checks whether the message contains ANSI escape code formatting.
| bool LogMessage::hasSubString | ( | const StringView & | s, |
| bool | ignore_case = false ) const |
Checks whether the message contains a given substring.
| [in] | s | The substring to search for. |
| [in] | ignore_case | Whether to perform a case-insensitive search. |
| bool LogMessage::isFromCurrentSession | ( | ) | const |
Checks whether this log message was generated during the current application session.
|
inline |
Checks whether this message is a session end marker.
Definition at line 156 of file LogMessage.h.
References LogSessionStart(), and m_message.
|
inline |
Checks whether this message is a session start marker.
Definition at line 151 of file LogMessage.h.
References LogSessionStart(), and m_message.
|
inline |
Returns the severity level of this log message.
Definition at line 182 of file LogMessage.h.
References m_error_level.
|
inlinestaticconstexpr |
Returns the sentinel string that marks the end of a log session.
Definition at line 146 of file LogMessage.h.
|
inlinestaticconstexpr |
Returns the sentinel string that marks the start of a log session.
Definition at line 141 of file LogMessage.h.
Referenced by isSessionEnd(), and isSessionStart().
| StringAllocatingView LogMessage::message | ( | bool | include_new_lines, |
| bool | include_tabs, | ||
| bool | include_colors ) const |
Returns the formatted message string with optional formatting controls.
| [in] | include_new_lines | Whether to include newline characters in the output. |
| [in] | include_tabs | Whether to include tab characters in the output. |
| [in] | include_colors | Whether to include ANSI color escape codes in the output. |
Referenced by LogMessage(), LogMessage(), LogMessage(), LogMessage(), and appendMessage().
|
inline |
Returns a mutable reference to the raw, unformatted message string.
Definition at line 120 of file LogMessage.h.
References m_message.
|
inline |
Returns a const reference to the raw, unformatted message string.
Definition at line 115 of file LogMessage.h.
References m_message.
|
inline |
Returns the timestamp when this log message was recorded.
Definition at line 168 of file LogMessage.h.
References m_time.
|
inline |
Returns the session number that produced this log message.
Definition at line 203 of file LogMessage.h.
References m_session_number.
|
inline |
Sets the severity level of this log message.
| [in] | level | The new error level. |
Definition at line 189 of file LogMessage.h.
References m_error_level.
|
inline |
Sets the timestamp of this log message.
| [in] | time | The new record time. |
Definition at line 175 of file LogMessage.h.
References m_time.
|
inline |
Sets the session number that produced this log message.
| [in] | session | The session number to assign. |
Definition at line 196 of file LogMessage.h.
References m_session_number.