34#include <NDEVR/Time.h>
35#include <NDEVR/String.h>
141 static constexpr StringView LogSessionStart() {
return "\\--------------------------------------------------------------------------------------------------|"; }
146 static constexpr StringView LogSessionEnd() {
return "/--------------------------------------------------------------------------------------------------|"; }
The equivelent of std::vector but with a bit more control.
Information for how to display text data.
LogMessage(const StringView &message, const uint01 error_level=e_notification)
Constructs a LogMessage from a string view with an optional error level.
bool hasFormatting() const
Checks whether the message contains ANSI escape code formatting.
uint01 logRecordLevel() const
Returns the severity level of this log message.
static constexpr StringView LogSessionEnd()
Returns the sentinel string that marks the end of a log session.
uint02 m_session_number
The session number that produced this message.
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()
Constructs a default LogMessage with no content.
static constexpr StringView LogSessionStart()
Returns the sentinel string that marks the start of a log session.
const String & rawMessage() const
Returns a const reference to the raw, unformatted message string.
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.
bool isSessionEnd() const
Checks whether this message is a session end marker.
void setSessionNumber(uint02 session)
Sets the session number that produced this log message.
uint02 sessionNumber() const
Returns the session number that produced this log message.
bool hasSubString(const StringView &s, bool ignore_case=false) const
Checks whether the message contains a given substring.
void setRecordTime(const Time &time)
Sets the timestamp of this log message.
ApplicationMessagePriority
Defines severity levels for log messages, ranging from success to critical error.
@ e_error
Error indicating a failure in an operation.
@ e_success
Operation completed successfully.
@ e_notification
Informational notification for general status updates.
@ e_debug
Debug-level message, not persisted to the log.
@ e_critical_error
Critical error indicating a severe or unrecoverable failure.
@ e_warning
Warning indicating a potential issue.
@ e_logged_debug
Debug-level message that is persisted to the log.
uint01 m_error_level
The severity level of this log message.
bool isSessionStart() const
Checks whether this message is a session start marker.
Buffer< std::pair< String, String > > ansiiEscapeBlocks() const
Parses the message into pairs of ANSI escape code sequences and their associated text.
Time m_time
The timestamp when the message was recorded.
AlocatingAlignedBuffer< TextBlock, 64 > messageBlocks(const Font &default_font) const
Converts the message into styled TextBlock objects using the specified default font.
LogMessage(const TranslatedString &message, const uint01 error_level=e_notification)
Constructs a LogMessage from a translated string with an optional error level.
Time recordTime() const
Returns the timestamp when this log message was recorded.
static uint02 CurrentLogSession()
Returns the identifier for the current active log session.
bool isFromCurrentSession() const
Checks whether this log message was generated during the current application session.
void setErrorLevel(uint01 level)
Sets the severity level of this log message.
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.
StringAllocatingView message(bool include_new_lines, bool include_tabs, bool include_colors) const
Returns the formatted message string with optional formatting controls.
String & rawMessage()
Returns a mutable reference to the raw, unformatted message string.
String m_message
The raw log message content.
This class is like a string view, but may optionally store the data internally Useful if the return t...
Logic for reading or writing to a string or a user friendly, TranslatedString.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Represents a timestamp with utilities for manipulation and conversion.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
text that is formatted the same way, typically part of a bigger group of text