LogMetadata#

Fully qualified name: omni::observability::LogMetadata

Defined in omni/observability/ObservabilityDebug.h

class LogMetadata#

Metadata storage for a single log message.

This metadata includes information such as the code location where the

Public Functions

LogMetadata() = default#
~LogMetadata() = default#
LogMetadata(
const char *channel_,
const char *filename_,
const char *function_,
LogLevel level_,
int32_t lineNumber_,
ThreadId threadId_,
ProcessId processId_,
)#

Constructor: initializes this log metadata object.

Parameters:
  • channel_[in] The log channel to emit the message with. This may not be nullptr.

  • filename_[in] The source file name and path where the message was emitted from.

  • function_[in] The name of the function that emitted the message.

  • level_[in] The log level that the log message was emitted from.

  • lineNumber_[in] The source file line number where the message was emitted.

  • threadId_[in] The OS ID of the thread that is emitting the message.

  • processId_[in] The OS ID of the process that is emitting the message.

inline LogMetadata(const LogMetadata &other)#

Constructor: copies the metadata from another object into this one.

Parameters:

other[in] The other object to copy data from.

inline LogMetadata &operator=(const LogMetadata &other)#

Assignment operator: copies the metadata from another object into this one.

Parameters:

other[in] The other object to copy data from.

Public Members

const char *channelName = ""#

The name of the log ‘channel’ this log message will be emitted on.

This will be one of the omni::observability::kOmni*Channel names. This will never be nullptr.

const char *filename = ""#

The name and path of the source file this log message is being emitted from.

This will never be nullptr.

const char *function = ""#

The name of the function that is emitting the log message.

This will never be nullptr.

LogLevel level = kLogLevelWarn#

The value of the log level this log message is being emitted from.

These levels are simply given as an integer value. This will default to kLogLevelWarn.

int32_t lineNumber = 0#

The source code line the log message is being emitted from.

ThreadId threadId = 0#

The OS identifier of the thread that this log message is being emitted from.

ProcessId processId = 0#

The OS identifier of the process that this log message is being emitted from.

std::chrono::nanoseconds timestamp#

The absolute time index in nanoseconds when this log message was emitted.

This will be relative to the Unix epoch of midnight January 1, 1970. It is the responsibility of the logger implementation to ensure that this timestamp is interpreted and printed properly.