Skip to content

Class Engine::LogWriter

ClassList > Engine > LogWriter

Single consumer of terminal log lines. More...

  • #include <LogWriter.hpp>

Public Static Attributes

Type Name
std::size_t Capacity = 1024
How many terminal lines are queued. Older lines are dropped.

Public Functions

Type Name
void Enqueue (LogLevel level, std::string message)
Queues one line for the worker.
LogWriter ()
LogWriter (const LogWriter &) = delete
void Shutdown ()
Drains the queue and joins the worker. A second call does nothing. Safe when the thread was never started.
LogWriter & operator= (const LogWriter &) = delete
~LogWriter ()

Detailed Description

The caller never blocks on the terminal. When the queue is full, the oldest line is dropped. Shutdown joins the worker once. After that, further lines are written on the caller. The web build does not start this thread.

Public Static Attributes Documentation

variable Capacity

How many terminal lines are queued. Older lines are dropped.

std::size_t Engine::LogWriter::Capacity;


Public Functions Documentation

function Enqueue

Queues one line for the worker.

void Engine::LogWriter::Enqueue (
    LogLevel level,
    std::string message
) 

Parameters:

  • level Stream and tag chosen by the worker.
  • message Raw message, without the terminal tag. Moved from.

function LogWriter [½]

Engine::LogWriter::LogWriter () 

function LogWriter [2/2]

Engine::LogWriter::LogWriter (
    const LogWriter &
) = delete

function Shutdown

Drains the queue and joins the worker. A second call does nothing. Safe when the thread was never started.

void Engine::LogWriter::Shutdown () 


function operator=

LogWriter & Engine::LogWriter::operator= (
    const LogWriter &
) = delete

function ~LogWriter

Engine::LogWriter::~LogWriter () 


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