vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
ven::Logger Class Reference

#include <Logger.hpp>

+ Collaboration diagram for ven::Logger:

Static Public Member Functions

static LoggergetInstance ()
 
template<typename Func >
static void logExecutionTime (const std::string &message, Func &&func)
 
static void logWarning (const std::string &message)
 

Private Member Functions

 Logger ()
 

Static Private Member Functions

static const char * getColorForDuration (const float duration)
 
static std::string formatLogMessage (LogLevel level, const std::string &message)
 

Static Private Attributes

static constexpr std::array< const char *, 2 > LOG_LEVEL_STRING = {"INFO", "WARNING"}
 
static constexpr std::array< const char *, 4 > LOG_LEVEL_COLOR = {"\033[31m", "\033[32m", "\033[33m", "\033[0m\n"}
 

Detailed Description

Definition at line 28 of file Logger.hpp.

Constructor & Destructor Documentation

◆ Logger()

ven::Logger::Logger ( )
private

Definition at line 3 of file logger.cpp.

Member Function Documentation

◆ formatLogMessage()

std::string ven::Logger::formatLogMessage ( LogLevel level,
const std::string & message )
staticnodiscardprivate

Definition at line 14 of file logger.cpp.

Referenced by logExecutionTime(), and logWarning().

+ Here is the caller graph for this function:

◆ getColorForDuration()

static const char * ven::Logger::getColorForDuration ( const float duration)
inlinestaticprivate

Definition at line 54 of file Logger.hpp.

References LOG_LEVEL_COLOR.

Referenced by logExecutionTime().

+ Here is the caller graph for this function:

◆ getInstance()

static Logger & ven::Logger::getInstance ( )
inlinestatic

Definition at line 32 of file Logger.hpp.

Referenced by main().

+ Here is the caller graph for this function:

◆ logExecutionTime()

template<typename Func >
static void ven::Logger::logExecutionTime ( const std::string & message,
Func && func )
inlinestatic

Definition at line 35 of file Logger.hpp.

References formatLogMessage(), getColorForDuration(), ven::Clock::getDeltaTimeMS(), ven::INFO, LOG_LEVEL_COLOR, and ven::Clock::update().

Referenced by ven::ModelFactory::loadAll(), ven::TextureFactory::loadAll(), ven::Engine::loadObjects(), and ven::SceneManager::SceneManager().

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

◆ logWarning()

static void ven::Logger::logWarning ( const std::string & message)
inlinestatic

Definition at line 45 of file Logger.hpp.

References formatLogMessage(), LOG_LEVEL_COLOR, and ven::WARNING.

Referenced by ven::ModelFactory::loadAll(), and ven::TextureFactory::loadAll().

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

Member Data Documentation

◆ LOG_LEVEL_COLOR

std::array<const char*, 4> ven::Logger::LOG_LEVEL_COLOR = {"\033[31m", "\033[32m", "\033[33m", "\033[0m\n"}
staticconstexprprivate

Definition at line 50 of file Logger.hpp.

Referenced by getColorForDuration(), logExecutionTime(), and logWarning().

◆ LOG_LEVEL_STRING

std::array<const char*, 2> ven::Logger::LOG_LEVEL_STRING = {"INFO", "WARNING"}
staticconstexprprivate

Definition at line 49 of file Logger.hpp.


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