#include <log.hh>
Public Methods | |
virtual | ~LogLevel () |
Destructor does nothing, since class is never instantiated. More... | |
virtual void | dummy () const=0 |
This purely virtual function makes class abstract, which ensures that class can never be instantiated. More... | |
Static Public Methods | |
void | addLevel (QString key, const int val) |
Adds a loglevel pair to both QMaps. More... | |
void | showLevels () |
Prints loglevel pairs to stdout. More... | |
bool | isGreaterOrEqual (const QString p, const QString q) |
Compares two levels, given their strings. More... | |
bool | isLevel (const QString key) |
Checks if a given string exists as a key in the QMap. More... | |
int | getValue (const QString key) |
Returns int value of a loglevel, given its key. More... | |
QString | getKey (const int value) |
Returns key of a loglevel, given its int value. More... | |
Private Methods | |
LogLevel () | |
Constructor does nothing, and is private to ensure that class cannot be instantiated. More... | |
Static Private Methods | |
void | init () |
Initializes hashes. More... | |
Static Private Attributes | |
StrIntMap | level |
QMap of log levels with QStrings as keys, ints as values. More... | |
IntStrMap | revLevel |
QMap of reversed levels, where ints are keys and QStrings values. More... | |
Friends | |
class | Hierarchy |
Make this a friend so that init method can be hidden from all others. More... |
Never instantiated. Keeps track of six default logging levels, which are, in order:
Fatal > Error > Warn > Notice > Info > DebugAllows user to create any number of other levels using the method addLevel(). Log levels are kept track of in two QMaps, one with QStrings as keys and integers as values, the other the opposite.
A LogLevel is a key/value pair stored in a the first kind of QMap, where the key is a descriptive label (all uppercase) and the value is an integer that serves to order the level. The default values of the QMap are:
FATAL = 600, ERROR = 500, WARN = 400, NOTICE = 300, INFO = 200, DEBUG = 100.The other kind of QMap simply reverses the ordering of these pairs, i.e., 100 is the key for the value DEBUG, etc.
One can add to these lists with the addLevel method. Knock yourself out...
|
Constructor does nothing, and is private to ensure that class cannot be instantiated.
|
|
Destructor does nothing, since class is never instantiated.
|
|
Adds a loglevel pair to both QMaps.
|
|
This purely virtual function makes class abstract, which ensures that class can never be instantiated.
|
|
Returns key of a loglevel, given its int value.
|
|
Returns int value of a loglevel, given its key.
|
|
Initializes hashes. Should only be called from Hierarchy constuctor, which is itself a private method. See Hierarchy for more details. |
|
Compares two levels, given their strings.
Returns
|
|
Checks if a given string exists as a key in the QMap.
|
|
Prints loglevel pairs to stdout. Obsolete method used for testing and should be removed. |
|
Make this a friend so that init method can be hidden from all others.
|
|
QMap of log levels with QStrings as keys, ints as values. We refer to this simply as THE QMap of levels. |
|
QMap of reversed levels, where ints are keys and QStrings values.
|