Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
Loading...
Searching...
No Matches
icarus::LogEntry Struct Reference

A single log entry with full context. More...

#include <LogService.hpp>

Collaboration diagram for icarus::LogEntry:

Public Member Functions

std::string Format (bool include_context=true) const
 Format for output: "[sim_time] [LEVEL] [entity.component] message".
std::string FormatColored (const Console &console) const
 Format with colors (for terminal).

Static Public Member Functions

static LogEntry Create (LogLevel level, double sim_time, std::string_view message, const LogContext &ctx)
 Create a log entry with current context.

Public Attributes

LogLevel level
 Severity level.
double sim_time
 Simulation time when logged.
std::string message
 Log message.
LogContext context
 Entity/component context.
std::chrono::steady_clock::time_point wall_time
 Wall clock time for ordering logs from concurrent sources.

Detailed Description

A single log entry with full context.

Immutable after creation. Collected into LogBuffer during hot loop.

Member Function Documentation

◆ Create()

LogEntry icarus::LogEntry::Create ( LogLevel level,
double sim_time,
std::string_view message,
const LogContext & ctx )
inlinestatic

Create a log entry with current context.

◆ Format()

std::string icarus::LogEntry::Format ( bool include_context = true) const
inlinenodiscard

Format for output: "[sim_time] [LEVEL] [entity.component] message".

◆ FormatColored()

std::string icarus::LogEntry::FormatColored ( const Console & console) const
inlinenodiscard

Format with colors (for terminal).

Member Data Documentation

◆ context

LogContext icarus::LogEntry::context

Entity/component context.

◆ level

LogLevel icarus::LogEntry::level

Severity level.

◆ message

std::string icarus::LogEntry::message

Log message.

◆ sim_time

double icarus::LogEntry::sim_time

Simulation time when logged.

◆ wall_time

std::chrono::steady_clock::time_point icarus::LogEntry::wall_time

Wall clock time for ordering logs from concurrent sources.


The documentation for this struct was generated from the following file: