Fray Engine
Loading...
Searching...
No Matches
fray::log::EngineLogSink Class Reference

Captures Engine logs before managers exist and forwards them once attached. Construct before startup logging. The attachment must be destroyed before its managers. More...

#include <engine_log_sink.hpp>

Classes

struct  Captured
 An owned log line captured before the managers were attached. More...
struct  State
 Shared callback state, kept alive by in-flight sink snapshots. More...
struct  ActiveCall
 Releases an in-flight call even if recording throws. More...
struct  RecursionGuard
 Restores the thread-local recursion guard. More...
class  Attachment
 Keeps the sink attached to live managers and detaches it on destruction. Declare after the managers so it is destroyed before them. More...

Public Member Functions

 EngineLogSink ()
 Installs the startup buffer before the managers are created.
 EngineLogSink (const EngineLogSink &)=delete
EngineLogSink & operator= (const EngineLogSink &)=delete
 ~EngineLogSink ()
 Removes the sink if it has not already been detached.
F_void stopForwarding ()
 Stops forwarding to the renderer while continuing to store Engine logs.

Private Member Functions

void detach ()
 Stops accepting sink calls and waits for existing calls to release the manager references. Call while both attached managers are still alive, and not from a sink callback.

Private Attributes

std::shared_ptr< State > _state = std::make_shared<State>()

Detailed Description

Captures Engine logs before managers exist and forwards them once attached. Construct before startup logging. The attachment must be destroyed before its managers.

Definition at line 28 of file engine_log_sink.hpp.

Constructor & Destructor Documentation

◆ EngineLogSink() [1/2]

fray::log::EngineLogSink::EngineLogSink ( )
inline

Installs the startup buffer before the managers are created.

Definition at line 105 of file engine_log_sink.hpp.

◆ EngineLogSink() [2/2]

fray::log::EngineLogSink::EngineLogSink ( const EngineLogSink & )
delete

◆ ~EngineLogSink()

fray::log::EngineLogSink::~EngineLogSink ( )
inline

Removes the sink if it has not already been detached.

Definition at line 143 of file engine_log_sink.hpp.

Member Function Documentation

◆ detach()

void fray::log::EngineLogSink::detach ( )
inlineprivate

Stops accepting sink calls and waits for existing calls to release the manager references. Call while both attached managers are still alive, and not from a sink callback.

Definition at line 81 of file engine_log_sink.hpp.

◆ operator=()

EngineLogSink & fray::log::EngineLogSink::operator= ( const EngineLogSink & )
delete

◆ stopForwarding()

F_void fray::log::EngineLogSink::stopForwarding ( )
inline

Stops forwarding to the renderer while continuing to store Engine logs.

Definition at line 185 of file engine_log_sink.hpp.

Member Data Documentation

◆ _state

std::shared_ptr<State> fray::log::EngineLogSink::_state = std::make_shared<State>()
private

Definition at line 75 of file engine_log_sink.hpp.


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