LogMessage#
Fully qualified name: carb::logging::LogMessage
Defined in carb/logging/Logger.h
-
struct LogMessage#
A structure defining a log message as passed to Logger2::handleMessage().
See also
Public Members
-
size_t sizeOf = {sizeof(LogMessage)}#
The size of the
LogMessage
structure, used as a version.To verify if a desired field is included, do this check:
msg.sizeOf >= (offsetof(LogMessage, <field>) + sizeof(LogMessage::<field>))
Warning
Only access fields that fit fully within the
sizeOf
! Fields up to and includingmessage
are always valid.
-
const char *source#
The source of the log message in UTF-8 encoding. Commonly this is the plugin name that generated the message, or the channel name. Will not be NULL.
-
const char *fileName#
The source code file name that generated the log message. May be NULL if not available.
-
int lineNumber#
The line number in
fileName
where the log message was generated from. Will be 0 if not available.
-
int32_t level#
The log severity level of the message.
See also
-
const char *moduleName#
The name of the module which generated the log message. May be NULL if not available.
-
const char *functionName#
The name of the function which generated the log message. May be NULL if not available.
-
const char *traceParentId#
The current traceparent ID for the thread that generated the message, or an empty string if no trace is active on the calling thread or OmniTrace is not enabled. Will not be NULL.
-
uint64_t timestampNs#
The log timestamp in nanoseconds based on std::chrono::steady_clock.
-
const char *message#
The log message in UTF-8 encoding. Will not be NULL.
-
const char *globalExtraFields#
A string containing the current global extra fields for this log message. This may be an empty string if no extra fields have been specified.
Warning
This field must be checked if it is safe to access in the passed version of a log message struct using a call to
CARB_INCLUDES_MEMBER(msg.sizeOf, carb::logging::LogMessage::globalExtraFields)
before attempting to access this member.
-
const char *threadExtraFields#
A string containing the current thread extra fields for this log message. This may be an empty string if no thread specific extra fields have been specified.
Warning
This field must be checked if it is safe to access in the passed version of a log message struct using a call to
CARB_INCLUDES_MEMBER(msg.sizeOf, carb::logging::LogMessage::threadExtraFields)
before attempting to access this member.
-
size_t sizeOf = {sizeof(LogMessage)}#