Log¶
Inherited: None
Description¶
The Log is used whenever the developer needs to write out debugging or tracing information to a file or console.
Common usecase:
Log(Log::ERR) << "Loading level:" << 1;
Public Methods¶
Log (Log::LogTypes type) |
|
~Log () |
|
Log & |
operator<< (bool b) |
Log & |
operator<< (char c) |
Log & |
operator<< (const TString & string) |
Log & |
operator<< (const char * string) |
Log & |
operator<< (const void * value) |
Log & |
operator<< (double d) |
Log & |
operator<< (float f) |
Log & |
operator<< (int i) |
Log & |
operator<< (long long i) |
Log & |
operator<< (short s) |
Log & |
operator<< (unsigned char c) |
Log & |
operator<< (unsigned int i) |
Log & |
operator<< (unsigned long long i) |
Log & |
operator<< (unsigned short s) |
Public Enums¶
enum Log::LogTypes
This enum defines the lavel of logging.
Constant |
Value |
Description |
Log::CRT |
0 |
Critical logging. For use with critical failures. |
Log::ERR |
1 |
Error logging. For use with unrecoverable failures. |
Log::WRN |
2 |
Warning logging. For use with recoverable failures. |
Log::INF |
3 |
Informational logging. Should be desabled in release. |
Log::DBG |
4 |
Debug logging. Should be desabled in release. |
Static Methods¶
void |
addHandler (LogHandler * handler) |
void |
setLogLevel (Log::LogTypes level) |
Methods Description¶
Log::Log (Log::LogTypes type)
Constructs a log stream that writes to the handler for the message type.
Log::~Log ()
Flushes any pending data to be written and destroys the log stream.
void Log::addHandler (LogHandler * handler)
Adds a new Log handler. This method can be used in case if a developer would need to move logging stream to someplace. For example to the console.
void Log::setLogLevel (Log::LogTypes level)
Set current log level output. Messages wich are below this level will be descarded.
Log & Log::operator<< (bool b)
Writes the boolean value, b, to the stream and returns a reference to the stream.
Log & Log::operator<< (char c)
Writes the singed 8 bit integer value, c, to the stream and returns a reference to the stream.
Writes the text string, to the stream and returns a reference to the stream.
Log & Log::operator<< (char * string)
Writes the ‘0’-terminated string, to the stream and returns a reference to the stream.
Log & Log::operator<< (void * value)
Writes the pointer value, to the stream and returns a reference to the stream.
Log & Log::operator<< (double d)
Writes the float value with double precision, d, to the stream and returns a reference to the stream.
Log & Log::operator<< (float f)
Writes the float value, f, to the stream and returns a reference to the stream.
Log & Log::operator<< (int i)
Writes the singed 32 bit integer value, i, to the stream and returns a reference to the stream.
Log & Log::operator<< (long i)
Writes the singed 64 bit integer value, i, to the stream and returns a reference to the stream.
Log & Log::operator<< (short s)
Writes the singed 16 bit integer value, s, to the stream and returns a reference to the stream.
Log & Log::operator<< (char c)
Writes the unsinged 8 bit integer value, c, to the stream and returns a reference to the stream.
Log & Log::operator<< (int i)
Writes the unsinged 32 bit integer value, i, to the stream and returns a reference to the stream.
Log & Log::operator<< (long i)
Writes the unsinged 64 bit integer value, i, to the stream and returns a reference to the stream.
Log & Log::operator<< (short s)
Writes the unsinged 16 bit integer value, s, to the stream and returns a reference to the stream.