HomeWaterLeaksDetection
|
#include <Logger.h>
Public Member Functions | |
void | addEntity (ILoggable *log) |
Adds another class to the logging system. More... | |
void | update () override |
Updates the class. More... | |
Static Public Member Functions | |
static Logger * | getInstance () |
Returns the instance of the class. More... | |
Private Member Functions | |
Logger () | |
Constructor of the class. More... | |
Logger (Logger const &) | |
Copy constructor of the class. More... | |
Logger & | operator= (Logger const &) |
Assignment operator of the class. More... | |
Private Attributes | |
std::vector< ILoggable * > | logs |
collection of classes that are registered in the logging system More... | |
TimePeriod | timePeriod = LOG_PERIOD |
time period for recognizing when the log should be printed out More... | |
Static Private Attributes | |
static Logger * | instance = NULL |
the instance of the class More... | |
This class sepresents a controller for the logging part of the system. It is mainly used for debugging and troubleshooting.
|
inlineprivate |
|
inlineprivate |
void Logger::addEntity | ( | ILoggable * | log | ) |
Adds another class to the logging system.
log | another class to be added |
Definition at line 10 of file Logger.cpp.
References logs.
Referenced by setup().
|
static |
Returns the instance of the class.
If the instance has not been created, it will create it and then return it.
Definition at line 5 of file Logger.cpp.
References instance, and Logger().
Referenced by setup().
|
overridevirtual |
Updates the class.
If the logging period has passed, it will go over all the classes in the collection and print the logs out to the terminal one by one.
Implements IControllable.
Definition at line 14 of file Logger.cpp.
References FORMAT_TIME, TimePeriod::isActive(), logs, and timePeriod.
|
staticprivate |
|
private |
collection of classes that are registered in the logging system
Definition at line 25 of file Logger.h.
Referenced by addEntity(), and update().
|
private |