Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::Logger Class Reference

#include <log.h>

Public Member Functions

 Logger ()
 ~Logger ()
 Logger (const Logger &)=delete
Logger & operator= (const Logger &)=delete
void AddSink (std::unique_ptr< LogSink > sink)
void ClearSinks ()
void SetMinLevel (Level level)
Level MinLevel () const
bool IsEnabled (Level level) const
void Write (Channel channel, Level level, std::string_view message, const std::source_location &location)
void Flush ()

Private Attributes

std::mutex m_mutex
std::vector< std::unique_ptr< LogSink > > m_sinks
std::atomic< Level > m_minLevel
chr::steady_clock::time_point m_startTime

Detailed Description

Definition at line 95 of file log.h.

Constructor & Destructor Documentation

◆ Logger() [1/2]

bicameral::Logger::Logger ( )

Definition at line 94 of file log.cpp.

References AddSink(), bicameral::CreateConsoleSink(), bicameral::CreateDebuggerSink(), m_minLevel, and m_startTime.

Referenced by Logger(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Logger()

bicameral::Logger::~Logger ( )

Definition at line 99 of file log.cpp.

References Flush().

Here is the call graph for this function:

◆ Logger() [2/2]

bicameral::Logger::Logger ( const Logger & )
delete

References Logger().

Here is the call graph for this function:

Member Function Documentation

◆ AddSink()

void bicameral::Logger::AddSink ( std::unique_ptr< LogSink > sink)

Definition at line 103 of file log.cpp.

References m_mutex, and m_sinks.

Referenced by Logger(), and bicameral::OpenLogFile().

Here is the caller graph for this function:

◆ ClearSinks()

void bicameral::Logger::ClearSinks ( )

Definition at line 111 of file log.cpp.

References m_mutex, and m_sinks.

◆ Flush()

void bicameral::Logger::Flush ( )

Definition at line 138 of file log.cpp.

References m_mutex, and m_sinks.

Referenced by ~Logger().

Here is the caller graph for this function:

◆ IsEnabled()

bool bicameral::Logger::IsEnabled ( Level level) const
inlinenodiscard

Definition at line 107 of file log.h.

References MinLevel().

Referenced by bicameral::CheckHresult(), and bicameral::Log().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MinLevel()

Level bicameral::Logger::MinLevel ( ) const
inlinenodiscard

Definition at line 106 of file log.h.

References m_minLevel.

Referenced by IsEnabled().

Here is the caller graph for this function:

◆ operator=()

Logger & bicameral::Logger::operator= ( const Logger & )
delete

References Logger().

Here is the call graph for this function:

◆ SetMinLevel()

void bicameral::Logger::SetMinLevel ( Level level)
inline

Definition at line 105 of file log.h.

References m_minLevel.

Referenced by anonymous_namespace{main.cpp}::Run().

Here is the caller graph for this function:

◆ Write()

void bicameral::Logger::Write ( Channel channel,
Level level,
std::string_view message,
const std::source_location & location )

Definition at line 116 of file log.cpp.

References m_mutex, m_sinks, m_startTime, and bicameral::Warning.

Referenced by bicameral::CheckHresult(), and bicameral::Log().

Here is the caller graph for this function:

Member Data Documentation

◆ m_minLevel

std::atomic<Level> bicameral::Logger::m_minLevel
private

Definition at line 116 of file log.h.

Referenced by Logger(), MinLevel(), and SetMinLevel().

◆ m_mutex

std::mutex bicameral::Logger::m_mutex
private

Definition at line 114 of file log.h.

Referenced by AddSink(), ClearSinks(), Flush(), and Write().

◆ m_sinks

std::vector<std::unique_ptr<LogSink> > bicameral::Logger::m_sinks
private

Definition at line 115 of file log.h.

Referenced by AddSink(), ClearSinks(), Flush(), and Write().

◆ m_startTime

chr::steady_clock::time_point bicameral::Logger::m_startTime
private

Definition at line 117 of file log.h.

Referenced by Logger(), and Write().


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