RDebug
Class in Core Module
Header: #include <src/core/RDebug.h>
Description
Section titled “Description”This class provides some static methods for printing debugging information to stderr.
The methods accept a format string and parameters in the same way as the printf functions from standard C.
Messages can be logged with different priorities.
While there is no restriction as to what is logged, it is a good idea to log the class name and function name first.
// output for development:qDebug("RMyClass::myFunction: i = %d", i);// warnings ("this should not happen under normal cicumstances"):qWarning("RMyClass::myFunction: cannot open file '%s'", fileName);// indication for a bug in the application:qWarning("RMyClass::myFunction: parent is NULL. Aborting.");Scriptable: This class is available in script environments.
Static Public Functions
Section titled “Static Public Functions”| static void | decCounter(const QString &id=RDEFAULT_QSTRING) |
| static int | getCounter(const QString &id=RDEFAULT_QSTRING) |
| static QString | getPrefix() |
| static void | hexDump(const QString &str) |
| static void | incCounter(const QString &id=RDEFAULT_QSTRING) |
| static void | printBacktrace(const QString &prefix=RDEFAULT_QSTRING) |
| static void | printCounter(const QString &id=RDEFAULT_QSTRING) |
| static void | printCounters(const QString &prefix=RDEFAULT_QSTRING) |
| static void | setPrefix(const QString &p) |
| static void | startTimer(int id=0)Starts a timer with the given ID. |
| static uint | stopTimer(const QString &msg)Stops the timer with ID 0 and prints the given message together with the time that has elapsed. |
| static uint | stopTimer(int id, const QString &msg, uint msThreshold=0)Stops the timer with the given ID and prints the given message together with the time that has elapsed. |
| static void | timeStamp() |
Static Private Attributes
Section titled “Static Private Attributes”| static QMap< QString, int > | counter |
| static QMutex | mutexCounter |
| static QString | prefix |
| static QMap< int, QElapsedTimer > | timer |
Member Documentation
Section titled “Member Documentation”decCounter
Section titled “decCounter”static void RDebug::decCounter(const QString &id=RDEFAULT_QSTRING)static
getCounter
Section titled “getCounter”static int RDebug::getCounter(const QString &id=RDEFAULT_QSTRING)static
getPrefix
Section titled “getPrefix”static QString RDebug::getPrefix()static inline
hexDump
Section titled “hexDump”static void RDebug::hexDump(const QString &str)static
incCounter
Section titled “incCounter”static void RDebug::incCounter(const QString &id=RDEFAULT_QSTRING)static
printBacktrace
Section titled “printBacktrace”static void RDebug::printBacktrace(const QString &prefix=RDEFAULT_QSTRING)static
printCounter
Section titled “printCounter”static void RDebug::printCounter(const QString &id=RDEFAULT_QSTRING)static
printCounters
Section titled “printCounters”static void RDebug::printCounters(const QString &prefix=RDEFAULT_QSTRING)static
setPrefix
Section titled “setPrefix”static void RDebug::setPrefix(const QString &p)static inline
startTimer
Section titled “startTimer”static void RDebug::startTimer(int id=0)static
Starts a timer with the given ID.
stopTimer
Section titled “stopTimer”static uint RDebug::stopTimer(const QString &msg)static inline
Stops the timer with ID 0 and prints the given message together with the time that has elapsed.
stopTimer
Section titled “stopTimer”static uint RDebug::stopTimer(int id, const QString &msg, uint msThreshold=0)static
Stops the timer with the given ID and prints the given message together with the time that has elapsed.
timeStamp
Section titled “timeStamp”static void RDebug::timeStamp()static
counter
Section titled “counter”static QMap< QString, int > RDebug::counterstatic private
mutexCounter
Section titled “mutexCounter”static QMutex RDebug::mutexCounterstatic private
prefix
Section titled “prefix”static QString RDebug::prefixstatic private
static QMap< int, QElapsedTimer > RDebug::timerstatic private
All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.