Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor::LoggerInstance Class Reference

#include <LoggerInstance.hpp>

Public Member Functions

 LoggerInstance (LoggerInstance const &)=delete
 
LoggerInstanceoperator= (LoggerInstance const &)=delete
 
CU_API LoggerInstance (LoggerInstance &&rhs) noexcept
 
CU_API LoggerInstanceoperator= (LoggerInstance &&rhs) noexcept
 
CU_API ~LoggerInstance () noexcept
 
CU_API LoggerInstance (ProgramConsole &console, LogType logType)
 sets the log file address.
 
CU_API void registerCallback (LogCallback const &callback, void *caller)
 Registers the logging callback.
 
CU_API void unregisterCallback (void *caller)
 Unregisters the logging callback.
 
CU_API void setFileName (Path const &logFilePath, LogType logType=LogType::eCount)
 sets the log file address
 
CU_API LogType getLevel () const
 
template<typename CharT >
void lockedLogTrace (std::basic_string< CharT > const &msg)
 Logs a trace message, from a std::basic_string< CharT >
 
template<typename CharT >
void lockedLogTraceNoLF (std::basic_string< CharT > const &msg)
 Logs a trace message, from a std::basic_string< CharT >
 
template<typename CharT >
void logTrace (std::basic_string< CharT > const &msg)
 Logs a trace message, from a std::basic_string< CharT >
 
template<typename CharT >
void logTrace (std::basic_ostream< CharT > const &msg)
 Logs a trace message, from a std::basic_ostream< CharT >
 
template<typename CharT >
void logTraceNoLF (std::basic_string< CharT > const &msg)
 Logs a trace message, from a std::basic_string< CharT >
 
template<typename CharT >
void logTraceNoLF (std::basic_ostream< CharT > const &msg)
 Logs a trace message, from a std::basic_ostream< CharT >
 
template<typename CharT >
void lockedLogDebug (std::basic_string< CharT > const &msg)
 Logs a debug message, from a std::basic_string< CharT >
 
template<typename CharT >
void lockedLogDebugNoLF (std::basic_string< CharT > const &msg)
 Logs a debug message, from a std::basic_string< CharT >
 
template<typename CharT >
void logDebug (std::basic_string< CharT > const &msg)
 Logs a debug message, from a std::basic_string< CharT >
 
template<typename CharT >
void logDebug (std::basic_ostream< CharT > const &msg)
 Logs a debug message, from a std::basic_ostream< CharT >
 
template<typename CharT >
void logDebugNoLF (std::basic_string< CharT > const &msg)
 Logs a debug message, from a std::basic_string< CharT >
 
template<typename CharT >
void logDebugNoLF (std::basic_ostream< CharT > const &msg)
 Logs a debug message, from a std::basic_ostream< CharT >
 
template<typename CharT >
void lockedLogInfo (std::basic_string< CharT > const &msg)
 Logs a message, from a std::basic_string< CharT >
 
template<typename CharT >
void lockedLogInfoNoLF (std::basic_string< CharT > const &msg)
 Logs a message, from a std::basic_string< CharT >
 
template<typename CharT >
void logInfo (std::basic_string< CharT > const &msg)
 Logs a message, from a std::basic_string< CharT >
 
template<typename CharT >
void logInfo (std::basic_ostream< CharT > const &msg)
 Logs a message, from a std::basic_ostream< CharT >
 
template<typename CharT >
void logInfoNoLF (std::basic_string< CharT > const &msg)
 Logs a message, from a std::basic_string< CharT >
 
template<typename CharT >
void logInfoNoLF (std::basic_ostream< CharT > const &msg)
 Logs a message, from a std::basic_ostream< CharT >
 
template<typename CharT >
void lockedLogWarning (std::basic_string< CharT > const &msg)
 Logs a warning, from a std::basic_string< CharT >
 
template<typename CharT >
void lockedLogWarningNoLF (std::basic_string< CharT > const &msg)
 Logs a warning, from a std::basic_string< CharT >
 
template<typename CharT >
void logWarning (std::basic_string< CharT > const &msg)
 Logs a warning, from a std::basic_string< CharT >
 
template<typename CharT >
void logWarning (std::basic_ostream< CharT > const &msg)
 Logs a warning, from a std::basic_ostream< CharT >
 
template<typename CharT >
void logWarningNoLF (std::basic_string< CharT > const &msg)
 Logs a warning, from a std::basic_string< CharT >
 
template<typename CharT >
void logWarningNoLF (std::basic_ostream< CharT > const &msg)
 Logs a warning, from a std::basic_ostream< CharT >
 
template<typename CharT >
void lockedLogError (std::basic_string< CharT > const &msg)
 Logs an error, from a std::basic_string< CharT >
 
template<typename CharT >
void lockedLogErrorNoLF (std::basic_string< CharT > const &msg)
 Logs an error, from a std::basic_string< CharT >
 
template<typename CharT >
void logError (std::basic_string< CharT > const &msg)
 Logs an error, from a std::basic_string< CharT >
 
template<typename CharT >
void logError (std::basic_ostream< CharT > const &msg)
 Logs an error, from a std::basic_ostream< CharT >
 
template<typename CharT >
void logErrorNoLF (std::basic_string< CharT > const &msg)
 Logs an error, from a std::basic_string< CharT >
 
template<typename CharT >
void logErrorNoLF (std::basic_ostream< CharT > const &msg)
 Logs an error, from a std::basic_ostream< CharT >
 
template<typename CharT >
void pushMessage (LogType type, std::basic_string< CharT > const &message, bool addLF=true)
 Pushes a message into the queue.
 
CU_API void flushQueue ()
 
MbString getHeader (uint8_t index) const noexcept
 
void lock () const
 
void unlock () const noexcept
 

Constructor & Destructor Documentation

◆ LoggerInstance() [1/3]

castor::LoggerInstance::LoggerInstance ( LoggerInstance const & )
delete

◆ LoggerInstance() [2/3]

CU_API castor::LoggerInstance::LoggerInstance ( LoggerInstance && rhs)
noexcept

◆ ~LoggerInstance()

CU_API castor::LoggerInstance::~LoggerInstance ( )
noexcept

◆ LoggerInstance() [3/3]

CU_API castor::LoggerInstance::LoggerInstance ( ProgramConsole & console,
LogType logType )

sets the log file address.

Parameters
[in]consoleThe console where messages will output.
[in]logTypeThe log type.

Member Function Documentation

◆ flushQueue()

CU_API void castor::LoggerInstance::flushQueue ( )

◆ getHeader()

MbString castor::LoggerInstance::getHeader ( uint8_t index) const
inlinenoexcept

◆ getLevel()

CU_API LogType castor::LoggerInstance::getLevel ( ) const
Returns
The current log level.

◆ lock()

void castor::LoggerInstance::lock ( ) const
inline

Referenced by pushMessage().

Here is the caller graph for this function:

◆ lockedLogDebug()

template<typename CharT >
void castor::LoggerInstance::lockedLogDebug ( std::basic_string< CharT > const & msg)
inline

Logs a debug message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eDebug, and castor::toUtf8().

Referenced by castor::DebugLoggerStreambufTraitsT< CharType >::log().

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

◆ lockedLogDebugNoLF()

template<typename CharT >
void castor::LoggerInstance::lockedLogDebugNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a debug message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eDebug, and castor::toUtf8().

Referenced by castor::DebugLoggerStreambufTraitsT< CharType >::logNoLF().

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

◆ lockedLogError()

template<typename CharT >
void castor::LoggerInstance::lockedLogError ( std::basic_string< CharT > const & msg)
inline

Logs an error, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eError, and castor::toUtf8().

Referenced by castor::ErrorLoggerStreambufTraitsT< CharType >::log().

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

◆ lockedLogErrorNoLF()

template<typename CharT >
void castor::LoggerInstance::lockedLogErrorNoLF ( std::basic_string< CharT > const & msg)
inline

Logs an error, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eError, and castor::toUtf8().

Referenced by castor::ErrorLoggerStreambufTraitsT< CharType >::logNoLF().

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

◆ lockedLogInfo()

template<typename CharT >
void castor::LoggerInstance::lockedLogInfo ( std::basic_string< CharT > const & msg)
inline

Logs a message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eInfo, and castor::toUtf8().

Referenced by castor::InfoLoggerStreambufTraitsT< CharType >::log().

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

◆ lockedLogInfoNoLF()

template<typename CharT >
void castor::LoggerInstance::lockedLogInfoNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eInfo, and castor::toUtf8().

Referenced by castor::InfoLoggerStreambufTraitsT< CharType >::logNoLF().

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

◆ lockedLogTrace()

template<typename CharT >
void castor::LoggerInstance::lockedLogTrace ( std::basic_string< CharT > const & msg)
inline

Logs a trace message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eTrace, and castor::toUtf8().

Referenced by castor::TraceLoggerStreambufTraitsT< CharType >::log().

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

◆ lockedLogTraceNoLF()

template<typename CharT >
void castor::LoggerInstance::lockedLogTraceNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a trace message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eTrace, and castor::toUtf8().

Referenced by castor::TraceLoggerStreambufTraitsT< CharType >::logNoLF().

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

◆ lockedLogWarning()

template<typename CharT >
void castor::LoggerInstance::lockedLogWarning ( std::basic_string< CharT > const & msg)
inline

Logs a warning, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eWarning, and castor::toUtf8().

Referenced by castor::WarningLoggerStreambufTraitsT< CharType >::log().

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

◆ lockedLogWarningNoLF()

template<typename CharT >
void castor::LoggerInstance::lockedLogWarningNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a warning, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eWarning, and castor::toUtf8().

Referenced by castor::WarningLoggerStreambufTraitsT< CharType >::logNoLF().

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

◆ logDebug() [1/2]

template<typename CharT >
void castor::LoggerInstance::logDebug ( std::basic_ostream< CharT > const & msg)
inline

Logs a debug message, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logDebug().

Here is the call graph for this function:

◆ logDebug() [2/2]

template<typename CharT >
void castor::LoggerInstance::logDebug ( std::basic_string< CharT > const & msg)
inline

Logs a debug message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eDebug, and pushMessage().

Referenced by logDebug().

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

◆ logDebugNoLF() [1/2]

template<typename CharT >
void castor::LoggerInstance::logDebugNoLF ( std::basic_ostream< CharT > const & msg)
inline

Logs a debug message, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logDebugNoLF().

Here is the call graph for this function:

◆ logDebugNoLF() [2/2]

template<typename CharT >
void castor::LoggerInstance::logDebugNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a debug message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eDebug, and pushMessage().

Referenced by logDebugNoLF().

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

◆ logError() [1/2]

template<typename CharT >
void castor::LoggerInstance::logError ( std::basic_ostream< CharT > const & msg)
inline

Logs an error, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logError().

Here is the call graph for this function:

◆ logError() [2/2]

template<typename CharT >
void castor::LoggerInstance::logError ( std::basic_string< CharT > const & msg)
inline

Logs an error, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eError, and pushMessage().

Referenced by logError().

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

◆ logErrorNoLF() [1/2]

template<typename CharT >
void castor::LoggerInstance::logErrorNoLF ( std::basic_ostream< CharT > const & msg)
inline

Logs an error, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logErrorNoLF().

Here is the call graph for this function:

◆ logErrorNoLF() [2/2]

template<typename CharT >
void castor::LoggerInstance::logErrorNoLF ( std::basic_string< CharT > const & msg)
inline

Logs an error, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eError, and pushMessage().

Referenced by logErrorNoLF().

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

◆ logInfo() [1/2]

template<typename CharT >
void castor::LoggerInstance::logInfo ( std::basic_ostream< CharT > const & msg)
inline

Logs a message, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logInfo().

Here is the call graph for this function:

◆ logInfo() [2/2]

template<typename CharT >
void castor::LoggerInstance::logInfo ( std::basic_string< CharT > const & msg)
inline

Logs a message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eInfo, and pushMessage().

Referenced by logInfo().

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

◆ logInfoNoLF() [1/2]

template<typename CharT >
void castor::LoggerInstance::logInfoNoLF ( std::basic_ostream< CharT > const & msg)
inline

Logs a message, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logInfoNoLF().

Here is the call graph for this function:

◆ logInfoNoLF() [2/2]

template<typename CharT >
void castor::LoggerInstance::logInfoNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eInfo, and pushMessage().

Referenced by logInfoNoLF().

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

◆ logTrace() [1/2]

template<typename CharT >
void castor::LoggerInstance::logTrace ( std::basic_ostream< CharT > const & msg)
inline

Logs a trace message, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logTrace().

Here is the call graph for this function:

◆ logTrace() [2/2]

template<typename CharT >
void castor::LoggerInstance::logTrace ( std::basic_string< CharT > const & msg)
inline

Logs a trace message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eTrace, and pushMessage().

Referenced by logTrace(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportAdded(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportCreation().

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

◆ logTraceNoLF() [1/2]

template<typename CharT >
void castor::LoggerInstance::logTraceNoLF ( std::basic_ostream< CharT > const & msg)
inline

Logs a trace message, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logTraceNoLF().

Here is the call graph for this function:

◆ logTraceNoLF() [2/2]

template<typename CharT >
void castor::LoggerInstance::logTraceNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a trace message, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eTrace, and pushMessage().

Referenced by logTraceNoLF().

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

◆ logWarning() [1/2]

template<typename CharT >
void castor::LoggerInstance::logWarning ( std::basic_ostream< CharT > const & msg)
inline

Logs a warning, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logWarning().

Here is the call graph for this function:

◆ logWarning() [2/2]

template<typename CharT >
void castor::LoggerInstance::logWarning ( std::basic_string< CharT > const & msg)
inline

Logs a warning, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eWarning, and pushMessage().

Referenced by logWarning(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportDuplicate(), castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportNull(), and castor::ResourceCacheBaseT< ResT, KeyT, TraitsT >::reportUnknown().

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

◆ logWarningNoLF() [1/2]

template<typename CharT >
void castor::LoggerInstance::logWarningNoLF ( std::basic_ostream< CharT > const & msg)
inline

Logs a warning, from a std::basic_ostream< CharT >

Parameters
[in]msgThe line to log

References logWarningNoLF().

Here is the call graph for this function:

◆ logWarningNoLF() [2/2]

template<typename CharT >
void castor::LoggerInstance::logWarningNoLF ( std::basic_string< CharT > const & msg)
inline

Logs a warning, from a std::basic_string< CharT >

Parameters
[in]msgThe line to log

References castor::eWarning, and pushMessage().

Referenced by logWarningNoLF().

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

◆ operator=() [1/2]

CU_API LoggerInstance & castor::LoggerInstance::operator= ( LoggerInstance && rhs)
noexcept

◆ operator=() [2/2]

LoggerInstance & castor::LoggerInstance::operator= ( LoggerInstance const & )
delete

◆ pushMessage()

template<typename CharT >
void castor::LoggerInstance::pushMessage ( LogType type,
std::basic_string< CharT > const & message,
bool addLF = true )
inline

Pushes a message into the queue.

Parameters
[in]typeThe message type.
[in]messageThe message.
[in]addLFWhether or not add a LF at the end.

References lock(), castor::makeUniqueLock(), and castor::toUtf8().

Referenced by logDebug(), logDebugNoLF(), logError(), logErrorNoLF(), logInfo(), logInfoNoLF(), logTrace(), logTraceNoLF(), logWarning(), and logWarningNoLF().

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

◆ registerCallback()

CU_API void castor::LoggerInstance::registerCallback ( LogCallback const & callback,
void * caller )

Registers the logging callback.

Parameters
[in]callbackThe callback
[in]callerPointer to user data, used to identify the callback

◆ setFileName()

CU_API void castor::LoggerInstance::setFileName ( Path const & logFilePath,
LogType logType = LogType::eCount )

sets the log file address

Parameters
[in]logFilePathThe log file path
[in]logTypeThe log type

◆ unlock()

void castor::LoggerInstance::unlock ( ) const
inlinenoexcept

◆ unregisterCallback()

CU_API void castor::LoggerInstance::unregisterCallback ( void * caller)

Unregisters the logging callback.

Parameters
[in]callerPointer to user data

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