Struct Log

Struct Documentation

struct Log

A log message.

Public Types

enum class LogLevel : uint8_t

Log level.

Values:

enumerator UNKNOWN

Unknown log level.

enumerator DEBUG

Debug log level.

enumerator INFO

Info log level.

enumerator WARNING

Warning log level.

enumerator ERROR

Error log level.

enumerator FATAL

Fatal log level.

Public Functions

FoxgloveError encode(uint8_t *ptr, size_t len, size_t *encoded_len)

Encoded the Log as protobuf to the provided buffer.

On success, writes the serialized length to *encoded_len. If the provided buffer has insufficient capacity, writes the required capacity to *encoded_len and returns FoxgloveError::BufferTooShort. If the message cannot be encoded, writes the reason to stderr and returns FoxgloveError::EncodeError.

Parameters:
  • ptr – the destination buffer. must point to at least len valid bytes.

  • len – the length of the destination buffer.

  • encoded_len – where the serialized length or required capacity will be written to.

Public Members

std::optional<Timestamp> timestamp

Timestamp of log message.

LogLevel level

Log level.

std::string message

Log message.

std::string name

Process or node name.

std::string file

Filename.

uint32_t line = 0

Line number in the file.

Public Static Functions

static Schema schema()

Get the Log schema.

The schema data returned is statically allocated.