diff options
| author | Jonathan Bauer | 2011-03-21 10:51:51 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2011-03-21 10:51:51 +0100 |
| commit | 635b5c64f3107d4c01ae314fb75e02c571b51c54 (patch) | |
| tree | 4d2a3a679a569f9133ca8d3d5f5159b393accde3 /src/loggerEngine.cpp | |
| parent | debug modes. -D now needs an arg: 0 for regular terminal output, 1 for debug ... (diff) | |
| download | fbgui-635b5c64f3107d4c01ae314fb75e02c571b51c54.tar.gz fbgui-635b5c64f3107d4c01ae314fb75e02c571b51c54.tar.xz fbgui-635b5c64f3107d4c01ae314fb75e02c571b51c54.zip | |
transformed c syntax comments to c++ convention...
Diffstat (limited to 'src/loggerEngine.cpp')
| -rw-r--r-- | src/loggerEngine.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/loggerEngine.cpp b/src/loggerEngine.cpp index 004c268..9121af5 100644 --- a/src/loggerEngine.cpp +++ b/src/loggerEngine.cpp @@ -1,8 +1,8 @@ #include "loggerEngine.h" -/***************************************************************************************************** - Custom Logger Engine for debugging on framebuffer -*****************************************************************************************************/ +// -------------------------------------------------------------------------------------------------- +// Custom Logger Engine for debugging on framebuffer +//--------------------------------------------------------------------------------------------------- loggerEngine_fb::loggerEngine_fb(QTextEdit *parent) : QxtLoggerEngine(){ // TODO: silly parent storing ... to change! _debugConsole = parent; @@ -28,8 +28,7 @@ bool loggerEngine_fb::isInitialized() const{ } void loggerEngine_fb::writeFormatted(QxtLogger::LogLevel level, const QList<QVariant> & msgs){ - /* TODO: handle different log levels */ - /* write the messages to the debug console */ + // TODO: handle different log levels if (msgs.isEmpty()) return; Q_FOREACH(const QVariant& out, msgs) { @@ -37,14 +36,14 @@ void loggerEngine_fb::writeFormatted(QxtLogger::LogLevel level, const QList<QVar _debugConsole->insertPlainText(out.toString()); } _debugConsole->insertPlainText(QString("\n")); - /* move to end of the document */ + // autoscroll QTextCursor c = _debugConsole->textCursor(); c.movePosition(QTextCursor::End); _debugConsole->setTextCursor(c); } -/***************************************************************************************************** - Modified QxtBasicSTDLoggerEngine -*****************************************************************************************************/ +//--------------------------------------------------------------------------------------------------- +// Modified QxtBasicSTDLoggerEngine +//--------------------------------------------------------------------------------------------------- loggerEngine_std::loggerEngine_std() : QxtBasicSTDLoggerEngine(){} loggerEngine_std::~loggerEngine_std(){} @@ -63,15 +62,6 @@ void loggerEngine_std::writeToStdErr(const QString& str_level, const QList<QVari *errstream << endl; } void loggerEngine_std::writeToStdOut(const QString& level, const QList<QVariant> & msgs){ - if (msgs.isEmpty()) return; - QString header = '[' + QTime::currentTime().toString("hh:mm:ss.zzz") + "] [" + level + "] "; - QTextStream* outstream = stdOutStream(); - Q_ASSERT(outstream); - *outstream << header; - Q_FOREACH(const QVariant& out, msgs){ - if (!out.isNull()){ - *outstream << out.toString(); - } - } - *outstream << endl; + // reimplementing this is needed for compiling, + // we only need write to std::err, so this function is not needed } |
