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

#include <Logger.hpp>

Inheritance diagram for castor::Logger:
Inheritance graph
[legend]
Collaboration diagram for castor::Logger:
Collaboration graph
[legend]

Public Member Functions

CU_API Logger (LogType level)
 Constructor.
 
LoggerInstancegetInstance () const
 Returns a pointer over the instance.
 

Static Public Member Functions

static CU_API LoggerInstanceinitialise (LogType logLevel)
 Initialises this logger instance level.
 
static CU_API void cleanup ()
 Destroys the Logger instance.
 
static CU_API LoggerInstancePtr createInstance (LogType logLevel)
 Creates a logger instance of given level.
 
static CU_API void registerCallback (LogCallback const &callback, void *caller)
 Registers the logging callback.
 
static CU_API void unregisterCallback (void *caller)
 Unregisters the logging callback.
 
static CU_API void setFileName (Path const &logFilePath, LogType logType=LogType::eCount)
 sets the log file address
 
static CU_API LogType getLevel ()
 
template<typename CharT >
static void logTrace (CharT const *msg)
 Logs a trace message.
 
template<typename CharT >
static void logTrace (std::basic_string_view< CharT > msg)
 Logs a trace message.
 
template<typename CharT >
static void logTrace (std::basic_string< CharT > const &msg)
 Logs a trace message.
 
template<typename CharT >
static void logTrace (std::basic_ostream< CharT > const &msg)
 Logs a trace message.
 
template<typename CharT >
static void logTraceNoNL (CharT const *msg)
 Logs a trace message.
 
template<typename CharT >
static void logTraceNoNL (std::basic_string_view< CharT > msg)
 Logs a trace message.
 
template<typename CharT >
static void logTraceNoNL (std::basic_string< CharT > const &msg)
 Logs a trace message.
 
template<typename CharT >
static void logTraceNoNL (std::basic_ostream< CharT > const &msg)
 Logs a trace message.
 
template<typename CharT >
static void logDebug (CharT const *msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebug (std::basic_string_view< CharT > msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebug (std::basic_string< CharT > const &msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebug (std::basic_ostream< CharT > const &msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebugNoNL (CharT const *msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebugNoNL (std::basic_string_view< CharT > msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebugNoNL (std::basic_string< CharT > const &msg)
 Logs a debug message.
 
template<typename CharT >
static void logDebugNoNL (std::basic_ostream< CharT > const &msg)
 Logs a debug message.
 
template<typename CharT >
static void logInfo (CharT const *msg)
 Logs a message.
 
template<typename CharT >
static void logInfo (std::basic_string_view< CharT > msg)
 Logs a message.
 
template<typename CharT >
static void logInfo (std::basic_string< CharT > const &msg)
 Logs a message.
 
template<typename CharT >
static void logInfo (std::basic_ostream< CharT > const &msg)
 Logs a message.
 
template<typename CharT >
static void logInfoNoNL (CharT const *msg)
 Logs a message.
 
template<typename CharT >
static void logInfoNoNL (std::basic_string_view< CharT > msg)
 Logs a message.
 
template<typename CharT >
static void logInfoNoNL (std::basic_string< CharT > const &msg)
 Logs a message.
 
template<typename CharT >
static void logInfoNoNL (std::basic_ostream< CharT > const &msg)
 Logs a message.
 
template<typename CharT >
static void logWarning (CharT const *msg)
 Logs a warning.
 
template<typename CharT >
static void logWarning (std::basic_string_view< CharT > msg)
 Logs a warning.
 
template<typename CharT >
static void logWarning (std::basic_string< CharT > const &msg)
 Logs a warning.
 
template<typename CharT >
static void logWarning (std::basic_ostream< CharT > const &msg)
 Logs a warning.
 
template<typename CharT >
static void logWarningNoNL (CharT const *msg)
 Logs a warning.
 
template<typename CharT >
static void logWarningNoNL (std::basic_string_view< CharT > msg)
 Logs a warning.
 
template<typename CharT >
static void logWarningNoNL (std::basic_string< CharT > const &msg)
 Logs a warning.
 
template<typename CharT >
static void logWarningNoNL (std::basic_ostream< CharT > const &msg)
 Logs a warning.
 
template<typename CharT >
static void logError (CharT const *msg)
 Logs an error.
 
template<typename CharT >
static void logError (std::basic_string_view< CharT > msg)
 Logs an error.
 
template<typename CharT >
static void logError (std::basic_string< CharT > const &msg)
 Logs an error.
 
template<typename CharT >
static void logError (std::basic_ostream< CharT > const &msg)
 Logs an error.
 
template<typename CharT >
static void logErrorNoNL (CharT const *msg)
 Logs an error.
 
template<typename CharT >
static void logErrorNoNL (std::basic_string_view< CharT > msg)
 Logs an error.
 
template<typename CharT >
static void logErrorNoNL (std::basic_string< CharT > const &msg)
 Logs an error.
 
template<typename CharT >
static void logErrorNoNL (std::basic_ostream< CharT > const &msg)
 Logs an error.
 
static CU_API LoggergetSingleton ()
 Returns a reference over the instance.
 
static CU_API LoggergetSingletonPtr ()
 Returns a pointer over the instance.
 

Additional Inherited Members

- Protected Member Functions inherited from castor::NonMovable
 NonMovable ()=default
 Constructor.
 
 ~NonMovable () noexcept=default
 Destructor.
 

Constructor & Destructor Documentation

◆ Logger()

CU_API castor::Logger::Logger ( LogType level)
explicit

Constructor.

Member Function Documentation

◆ cleanup()

static CU_API void castor::Logger::cleanup ( )
static

Destroys the Logger instance.

◆ createInstance()

static CU_API LoggerInstancePtr castor::Logger::createInstance ( LogType logLevel)
static

Creates a logger instance of given level.

Parameters
[in]logLevelThe log level.

◆ getInstance()

LoggerInstance * castor::Logger::getInstance ( ) const
inline

Returns a pointer over the instance.

Returns
The instance

◆ getLevel()

static CU_API LogType castor::Logger::getLevel ( )
static
Returns
The current log level.

◆ getSingleton()

static CU_API Logger & castor::Logger::getSingleton ( )
static

Returns a reference over the instance.

Returns
The instance

◆ getSingletonPtr()

static CU_API Logger * castor::Logger::getSingletonPtr ( )
static

Returns a pointer over the instance.

Returns
The instance

◆ initialise()

static CU_API LoggerInstance * castor::Logger::initialise ( LogType logLevel)
static

Initialises this logger instance level.

Parameters
[in]logLevelThe log level

◆ logDebug() [1/4]

template<typename CharT >
static void castor::Logger::logDebug ( CharT const * msg)
inlinestatic

Logs a debug message.

Parameters
[in]msgThe line to log

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

Referenced by logDebug().

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

◆ logDebug() [2/4]

template<typename CharT >
static void castor::Logger::logDebug ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a debug message.

Parameters
[in]msgThe line to log

References logDebug().

Here is the call graph for this function:

◆ logDebug() [3/4]

template<typename CharT >
static void castor::Logger::logDebug ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a debug message.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logDebug() [4/4]

template<typename CharT >
static void castor::Logger::logDebug ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a debug message.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logDebugNoNL() [1/4]

template<typename CharT >
static void castor::Logger::logDebugNoNL ( CharT const * msg)
inlinestatic

Logs a debug message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Referenced by logDebugNoNL().

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

◆ logDebugNoNL() [2/4]

template<typename CharT >
static void castor::Logger::logDebugNoNL ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a debug message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

References logDebugNoNL().

Here is the call graph for this function:

◆ logDebugNoNL() [3/4]

template<typename CharT >
static void castor::Logger::logDebugNoNL ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a debug message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logDebugNoNL() [4/4]

template<typename CharT >
static void castor::Logger::logDebugNoNL ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a debug message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logError() [1/4]

template<typename CharT >
static void castor::Logger::logError ( CharT const * msg)
inlinestatic

Logs an error.

Parameters
[in]msgThe line to log

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

Referenced by logError().

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

◆ logError() [2/4]

template<typename CharT >
static void castor::Logger::logError ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs an error.

Parameters
[in]msgThe line to log

References logError().

Here is the call graph for this function:

◆ logError() [3/4]

template<typename CharT >
static void castor::Logger::logError ( std::basic_string< CharT > const & msg)
inlinestatic

Logs an error.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logError() [4/4]

template<typename CharT >
static void castor::Logger::logError ( std::basic_string_view< CharT > msg)
inlinestatic

Logs an error.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logErrorNoNL() [1/4]

template<typename CharT >
static void castor::Logger::logErrorNoNL ( CharT const * msg)
inlinestatic

Logs an error.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Referenced by logErrorNoNL().

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

◆ logErrorNoNL() [2/4]

template<typename CharT >
static void castor::Logger::logErrorNoNL ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs an error.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

References logErrorNoNL().

Here is the call graph for this function:

◆ logErrorNoNL() [3/4]

template<typename CharT >
static void castor::Logger::logErrorNoNL ( std::basic_string< CharT > const & msg)
inlinestatic

Logs an error.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logErrorNoNL() [4/4]

template<typename CharT >
static void castor::Logger::logErrorNoNL ( std::basic_string_view< CharT > msg)
inlinestatic

Logs an error.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logInfo() [1/4]

template<typename CharT >
static void castor::Logger::logInfo ( CharT const * msg)
inlinestatic

Logs a message.

Parameters
[in]msgThe line to log

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

Referenced by logInfo().

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

◆ logInfo() [2/4]

template<typename CharT >
static void castor::Logger::logInfo ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a message.

Parameters
[in]msgThe line to log

References logInfo().

Here is the call graph for this function:

◆ logInfo() [3/4]

template<typename CharT >
static void castor::Logger::logInfo ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a message.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logInfo() [4/4]

template<typename CharT >
static void castor::Logger::logInfo ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a message.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logInfoNoNL() [1/4]

template<typename CharT >
static void castor::Logger::logInfoNoNL ( CharT const * msg)
inlinestatic

Logs a message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Referenced by logInfoNoNL().

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

◆ logInfoNoNL() [2/4]

template<typename CharT >
static void castor::Logger::logInfoNoNL ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

References logInfoNoNL().

Here is the call graph for this function:

◆ logInfoNoNL() [3/4]

template<typename CharT >
static void castor::Logger::logInfoNoNL ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logInfoNoNL() [4/4]

template<typename CharT >
static void castor::Logger::logInfoNoNL ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logTrace() [1/4]

template<typename CharT >
static void castor::Logger::logTrace ( CharT const * msg)
inlinestatic

Logs a trace message.

Parameters
[in]msgThe line to log

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

Referenced by logTrace().

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

◆ logTrace() [2/4]

template<typename CharT >
static void castor::Logger::logTrace ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a trace message.

Parameters
[in]msgThe line to log

References logTrace().

Here is the call graph for this function:

◆ logTrace() [3/4]

template<typename CharT >
static void castor::Logger::logTrace ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a trace message.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logTrace() [4/4]

template<typename CharT >
static void castor::Logger::logTrace ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a trace message.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logTraceNoNL() [1/4]

template<typename CharT >
static void castor::Logger::logTraceNoNL ( CharT const * msg)
inlinestatic

Logs a trace message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Referenced by logTraceNoNL().

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

◆ logTraceNoNL() [2/4]

template<typename CharT >
static void castor::Logger::logTraceNoNL ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a trace message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

References logTraceNoNL().

Here is the call graph for this function:

◆ logTraceNoNL() [3/4]

template<typename CharT >
static void castor::Logger::logTraceNoNL ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a trace message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logTraceNoNL() [4/4]

template<typename CharT >
static void castor::Logger::logTraceNoNL ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a trace message.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logWarning() [1/4]

template<typename CharT >
static void castor::Logger::logWarning ( CharT const * msg)
inlinestatic

Logs a warning.

Parameters
[in]msgThe line to log

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

Referenced by logWarning().

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

◆ logWarning() [2/4]

template<typename CharT >
static void castor::Logger::logWarning ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a warning.

Parameters
[in]msgThe line to log

References logWarning().

Here is the call graph for this function:

◆ logWarning() [3/4]

template<typename CharT >
static void castor::Logger::logWarning ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a warning.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logWarning() [4/4]

template<typename CharT >
static void castor::Logger::logWarning ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a warning.

Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logWarningNoNL() [1/4]

template<typename CharT >
static void castor::Logger::logWarningNoNL ( CharT const * msg)
inlinestatic

Logs a warning.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Referenced by logWarningNoNL().

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

◆ logWarningNoNL() [2/4]

template<typename CharT >
static void castor::Logger::logWarningNoNL ( std::basic_ostream< CharT > const & msg)
inlinestatic

Logs a warning.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

References logWarningNoNL().

Here is the call graph for this function:

◆ logWarningNoNL() [3/4]

template<typename CharT >
static void castor::Logger::logWarningNoNL ( std::basic_string< CharT > const & msg)
inlinestatic

Logs a warning.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ logWarningNoNL() [4/4]

template<typename CharT >
static void castor::Logger::logWarningNoNL ( std::basic_string_view< CharT > msg)
inlinestatic

Logs a warning.

Remarks
Doesn't print the new line character.
Parameters
[in]msgThe line to log

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

Here is the call graph for this function:

◆ registerCallback()

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

Registers the logging callback.

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

◆ setFileName()

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

sets the log file address

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

◆ unregisterCallback()

static CU_API void castor::Logger::unregisterCallback ( void * caller)
static

Unregisters the logging callback.

Parameters
[in]callerPointer to user data

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