Ocular Engine
Ocular::Core::Logger Class Reference

#include <Logger.hpp>

Public Member Functions

void registerListener (ILoggerListener *listener)
 
template<typename T , typename... U>
void debug (T first, U...args)
 
template<typename T , typename... U>
void info (T first, U...args)
 
template<typename T , typename... U>
void warning (T first, U...args)
 
template<typename T , typename... U>
void error (T first, U...args)
 
void error (Exception &e)
 
template<typename T , typename... U>
void fatal (T first, U...args)
 

Detailed Description

Warning
Currently NOT threadsafe

Member Function Documentation

template<typename T , typename... U>
void Ocular::Core::Logger::debug ( first,
U...  args 
)
inline

Sends a message through the debug logger channel.

template<typename T , typename... U>
void Ocular::Core::Logger::error ( first,
U...  args 
)
inline

Sends a message through the error logger channel.

This should be used for any error that is fatal to the operation but not the service or application as a whole. An example of this would be if a file, that is necessary for a function, is not found.

void Ocular::Core::Logger::error ( Exception e)

Sends an exception error through the error logger channel.

template<typename T , typename... U>
void Ocular::Core::Logger::fatal ( first,
U...  args 
)
inline

Sends a message through the fatal logger channel.

This should be used for any error that is fatal to the application or service as a whole. A fatal error will cause the program to terminate.

Typically, there should be no message following a fatal message as the program will have ceased.

template<typename T , typename... U>
void Ocular::Core::Logger::info ( first,
U...  args 
)
inline

Sends a message through the info logger channel.

This should be used for generally useful information, such as services stops and starts, that you want to always be available but don't typically care about under normal circumstances.

void Ocular::Core::Logger::registerListener ( ILoggerListener listener)

Registers a new logger listener with the Logger.
The listener will receive all messages sent to this Logger instance.

Parameters
[in]listener
template<typename T , typename... U>
void Ocular::Core::Logger::warning ( first,
U...  args 
)
inline

Sends a message through the warning logger channel.

This should be used for anything that can potentially cause application oddities, but for which there is a system in place for automatic recovery. For example, this could be missing input to a method but the operation can still continue.


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