Log Class Reference

Log manager. More...

#include <log.h>

+ Inheritance diagram for Log:

Public Slots

void addEntry (const QString &string)
 
void addUnformattedEntry (const QString &string)
 
void clearContent ()
 Clears log content stored in the memory. More...
 

Signals

void newEntry (const QString &entry)
 

Public Member Functions

bool areTimestampsEnabled () const
 Timestamps are in format [hh:mm:ss]. Enabled by default. More...
 
const QString & content () const
 Entire content of the log. More...
 
bool isPrintingToStdout () const
 If true all new entries will also be printed to stdout. More...
 
Logoperator<< (const QString &string)
 Executes addEntry(const QString&). More...
 
void setPrintingToStdout (bool b)
 
void setTimestampsEnabled (bool b)
 

Static Public Attributes

static Log instance
 Global instance of the logger. More...
 

Detailed Description

Log manager.

Definition at line 37 of file log.h.

Member Function Documentation

void Log::addEntry ( const QString &  string)
slot

Prints the string to specified output and appends a '\n' character to the end of that string. Additional formatting is also applied if certain flags are enabled.

See Also
newEntry()

Definition at line 52 of file log.cpp.

void Log::addUnformattedEntry ( const QString &  string)
slot

Prints the string to specified output AS IT IS.

See Also
addEntry()
newEntry()

Definition at line 64 of file log.cpp.

bool Log::areTimestampsEnabled ( ) const

Timestamps are in format [hh:mm:ss]. Enabled by default.

Definition at line 77 of file log.cpp.

void Log::clearContent ( )
slot

Clears log content stored in the memory.

Definition at line 82 of file log.cpp.

const QString & Log::content ( ) const

Entire content of the log.

Definition at line 87 of file log.cpp.

bool Log::isPrintingToStdout ( ) const

If true all new entries will also be printed to stdout.

Otherwise entries are stored only in the logContent member. Default is true.

Definition at line 92 of file log.cpp.

void Log::newEntry ( const QString &  entry)
signal

Sends out an already formatted new entry. Please note that there are no additional newline character appended to the entry string. This is emitted by addEntry() and addUnformattedEntry() slots.

Log & Log::operator<< ( const QString &  string)

Executes addEntry(const QString&).

Definition at line 97 of file log.cpp.

Member Data Documentation

Log Log::instance
static

Global instance of the logger.

Definition at line 39 of file log.h.


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