|
WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
|
Singleton logging facility that dispatches formatted messages to LogOutput sinks. More...
#include <Logger.h>
Public Types | |
| enum | LogType { INFO_LOG = 0 , WARNING_LOG , ERROR_LOG , FATAL_LOG } |
Public Types inherited from Container< LogOutput > | |
| typedef std::unordered_set< LogOutput * >::iterator | iterator |
Public Member Functions | |
| void | dispatchLog (int type, const std::string &msg) |
| Send a pre-formatted message to all registered outputs. | |
| LogStream | operator() (Logger::LogType type) |
| Create a LogStream for the given severity level. | |
Public Member Functions inherited from Container< LogOutput > | |
| Container () | |
| virtual | ~Container () |
| virtual bool | addChild (LogOutput *child) |
| virtual bool | removeChild (LogOutput *child) |
| void | removeAllChildren () |
| virtual void | onChildAdded (LogOutput *) |
| virtual void | onChildRemoved (LogOutput *) |
| int | removeAllChildrenOfType () |
| unsigned int | nbChildren () const |
| bool | findChildComponent (Component *child, bool recursive=false) |
| Component * | getChild (unsigned int index) |
| const Component * | getChild (unsigned int index) const |
| iterator | begin () |
| iterator | end () |
Public Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component () |
| virtual bool | addChild (Component *) |
| Add a child component to this node. | |
| virtual bool | removeChild (Component *) |
| Remove a child component from this node. | |
| void | setParentComponent (Component *) |
| Set the parent of this component. | |
| virtual void | onParentSet (Component *) |
| Called after the parent has been set; override for custom logic. | |
| const Component * | parent () const |
| Get the parent component (const). | |
| Component * | parent () |
| Get the parent component. | |
| template<class DataType > | |
| const DataType * | firstParentOfType () |
| Walk up the parent chain and return the first ancestor of the given type. | |
| void | ref () |
| Increment the reference counter. | |
| void | unref () |
| Decrement the reference counter; deletes this when it reaches zero. | |
| void | setName (const std::string &name) |
| std::string | name () const |
| virtual void | onNameChanged () |
| void | print (int l_depth=0) |
| virtual void | doPrint () |
| void | copy (const Component &component, bool) |
Static Public Member Functions | |
| static Logger & | instance () |
| static void | init () |
| Initialise the logging subsystem (creates console and file outputs). | |
| static std::string | formatLog (int type, const std::string &msg) |
| Format a log message with a severity prefix and timestamp. | |
Private Member Functions | |
| Logger () | |
| Logger (const Logger &)=delete | |
| Logger & | operator= (const Logger &)=delete |
Static Private Attributes | |
| static Logger * | m_instance = nullptr |
Singleton logging facility that dispatches formatted messages to LogOutput sinks.
Access via the LOGGER macro or the convenience macros LOG_INFO, LOG_ERROR, LOG_WARNING, and LOG_FATAL. Outputs are added as children (see Container).
|
private |
Definition at line 15 of file Logger.cpp.
|
privatedelete |
| void Logger::dispatchLog | ( | int | type, |
| const std::string & | msg | ||
| ) |
Send a pre-formatted message to all registered outputs.
Definition at line 24 of file Logger.cpp.
|
static |
Format a log message with a severity prefix and timestamp.
Definition at line 31 of file Logger.cpp.
|
static |
Initialise the logging subsystem (creates console and file outputs).
Definition at line 20 of file Logger.cpp.
|
inlinestatic |
| LogStream Logger::operator() | ( | Logger::LogType | type | ) |
Create a LogStream for the given severity level.
Definition at line 63 of file Logger.cpp.