Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
Log Class Reference

Log manager. More...

#include <log.h>

List of all members.

Public Slots

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

Signals

void newEntry (const QString &entry)

Public Member Functions

bool areTimestampsEnabled () const
const QString & content () const
void logPrintf (const char *str,...)
void logUnformattedPrintf (const char *str,...)
bool isPrintingToStdout () const
void setPrintingToStdout (bool b)
void setTimestampsEnabled (bool b)
Logoperator<< (const QString &string)
 Executes addEntry(const QString&).

Static Public Attributes

static Log instance
 Global instance of the logger.

Protected Member Functions

int doLogPrintf (char *output, unsigned outputSize, const char *str, va_list argList)

Protected Attributes

QString logContent
 Entire content of the log.
QMutex thisMutex
bool printToStdout
bool timestamps
 Timestamps are in format [hh:mm:ss]. Enabled by default.

Detailed Description

Log manager.


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()
void Log::addUnformattedEntry ( const QString &  string) [slot]

Prints the string to specified output AS IT IS.

See also:
addEntry()
newEntry()
void Log::logPrintf ( const char *  str,
  ... 
)

Works like printf() from stdio. After the output string is constructed it is passed to addEntry() where additional formatting is applied.

void Log::logUnformattedPrintf ( const char *  str,
  ... 
)

Works like printf() from stdio. After the output string is constructed it is displayed AS IS, without any additional formatting.

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.


Member Data Documentation

bool Log::printToStdout [protected]

If true all new entries will also be printed to stdout. Otherwise entries are stored only in the logContent member. Default is true.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator