summaryrefslogtreecommitdiffstats
path: root/src/loggerengine.cpp
diff options
context:
space:
mode:
authorNiklas Goby2011-11-23 11:56:19 +0100
committerNiklas Goby2011-11-23 11:56:19 +0100
commitc0b6b199a9878bc1e95907200501211c09c1e66c (patch)
tree0079c34c6536e5f1d0414aebde1793db60a78f35 /src/loggerengine.cpp
parentdeleted the NetworkDiscovery and UnixDomainSocketServer folder (diff)
downloadfbgui-c0b6b199a9878bc1e95907200501211c09c1e66c.tar.gz
fbgui-c0b6b199a9878bc1e95907200501211c09c1e66c.tar.xz
fbgui-c0b6b199a9878bc1e95907200501211c09c1e66c.zip
created modules
Diffstat (limited to 'src/loggerengine.cpp')
-rw-r--r--src/loggerengine.cpp116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/loggerengine.cpp b/src/loggerengine.cpp
deleted file mode 100644
index 8a0991d..0000000
--- a/src/loggerengine.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-#include "loggerengine.h"
-
-// --------------------------------------------------------------------------------------------------
-// base of a custom logger engine for the framebuffer
-//---------------------------------------------------------------------------------------------------
-LoggerEngine_fb::LoggerEngine_fb(QTextEdit *parent) :
- QxtLoggerEngine() {
- _debugConsole = parent;
- //_initialized = false;
- //setLogLevelsEnabled(QxtLogger::DebugLevel);
- //enableLogging();
-}
-LoggerEngine_fb::~LoggerEngine_fb() {
-}
-
-void LoggerEngine_fb::initLoggerEngine() {
- //_initialized = true;
- return;
-}
-
-void LoggerEngine_fb::killLoggerEngine() {
- return;
-}
-
-void LoggerEngine_fb::setLogLevelEnabled(QxtLogger::LogLevels, bool) {
- //QxtLoggerEngine::setLogLevelsEnabled(level, enable);
- //if (!enable) QxtLoggerEngine::setLogLevelsEnabled(QxtLogger::DebugLevel);
-}
-bool LoggerEngine_fb::isInitialized() const {
- //return _initialized;
- return true;
-}
-
-void LoggerEngine_fb::writeFormatted(QxtLogger::LogLevel level, const QList<QVariant> & msgs) {
-
- // ignore in case no messages was passed.
- if (msgs.isEmpty())
- return;
-
- // write timestamp header in format: [hh:mm:ss.zzz]
- // example: [23:58:99.999]
- QString header = '[' + QTime::currentTime().toString("hh:mm:ss.zzz") + "] ";
- _debugConsole->insertPlainText(header);
-
- // only write to console for debug level
- if (level == QxtLogger::DebugLevel) {
- Q_FOREACH(const QVariant& out, msgs)
- {
- if (!out.isNull())
- _debugConsole->insertPlainText(out.toString());
- }
- _debugConsole->insertPlainText(QString("\n"));
- // autoscroll
- QTextCursor c = _debugConsole->textCursor();
- c.movePosition(QTextCursor::End);
- _debugConsole->setTextCursor(c);
- }
-}
-//---------------------------------------------------------------------------------------------------
-// slighty modified QxtBasicSTDLoggerEngine
-//---------------------------------------------------------------------------------------------------
-LoggerEngine_std::LoggerEngine_std() :
- QxtBasicSTDLoggerEngine() {
-}
-
-LoggerEngine_std::~LoggerEngine_std() {
-}
-
-void LoggerEngine_std::writeToStdErr(const QString&, const QList<QVariant> &msgs) {
-
- if (msgs.isEmpty())
- return;
- QString header = '[' + QTime::currentTime().toString("hh:mm:ss.zzz") + "] ";
- QTextStream* errstream = stdErrStream();
- Q_ASSERT(errstream);
- *errstream << header;
- Q_FOREACH(const QVariant& out, msgs)
- {
- if (!out.isNull())
- *errstream << out.toString();
- }
- *errstream << endl;
-}
-void LoggerEngine_std::writeToStdOut(const QString&, const QList<QVariant> &) {
- // (level, msgs)
- // reimplementing this is needed for compiling,
- // we only need write to std::err, so this function is not needed
-}
-//---------------------------------------------------------------------------------------------------
-// slighty modified QxtBasicFileLoggerEngine
-//---------------------------------------------------------------------------------------------------
-LoggerEngine_file::LoggerEngine_file(const QString& logFileName) :
- QxtBasicFileLoggerEngine(logFileName) {
- //setLogFileName(logFileName);
-}
-
-LoggerEngine_file::~LoggerEngine_file() {
-}
-
-void LoggerEngine_file::initLoggerEngine() {
-}
-
-void LoggerEngine_file::writeToFile(const QString&, const QList<QVariant> &msgs) {
-
- if (msgs.isEmpty())
- return;
- QIODevice* file = device();
- QString header = '[' + QTime::currentTime().toString("hh:mm:ss.zzz") + "] ";
- file->write(header.toUtf8());
- Q_FOREACH(const QVariant& out, msgs)
- {
- if (!out.isNull())
- file->write(out.toString().toUtf8());
- }
- file->write("\n");
-}