Skip to content

Class Engine::LogBuffer

ClassList > Engine > LogBuffer

Process-wide ring of the most recent user error messages. More...

  • #include <LogBuffer.hpp>

Public Static Attributes

Type Name
std::size_t Capacity = 512
How many lines are kept. Older lines are overwritten.

Public Functions

Type Name
void CopyEntriesInOrder (std::vector< LogEntry > & out) const
Copies stored lines from oldest to newest.
LogBuffer ()
void Push (LogLevel level, const std::string & message)
Appends one line, overwriting the oldest when the ring is full.

Detailed Description

Push and CopyEntriesInOrder share one mutex. Capacity is fixed; Push drops the oldest line once full. Engine lines are not stored here.

Public Static Attributes Documentation

variable Capacity

How many lines are kept. Older lines are overwritten.

std::size_t Engine::LogBuffer::Capacity;


Public Functions Documentation

function CopyEntriesInOrder

Copies stored lines from oldest to newest.

void Engine::LogBuffer::CopyEntriesInOrder (
    std::vector< LogEntry > & out
) const

Parameters:

  • out Cleared, then filled. Capacity is reused when it is already large enough.

function LogBuffer

Engine::LogBuffer::LogBuffer () 

function Push

Appends one line, overwriting the oldest when the ring is full.

void Engine::LogBuffer::Push (
    LogLevel level,
    const std::string & message
) 

Parameters:

  • level Severity stored with the line.
  • message Raw message, without the terminal tag.


The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Logging/LogBuffer.hpp