28 #define QgsDebugMsg(str) QgsLogger::debug(QString(str), 1, __FILE__, __FUNCTION__, __LINE__) 29 #define QgsDebugMsgLevel(str, level) QgsLogger::debug(QString(str), (level), __FILE__, __FUNCTION__, __LINE__) 30 #define QgsDebugCall QgsScopeLogger _qgsScopeLogger(__FILE__, __FUNCTION__, __LINE__) 33 #define QgsDebugMsg(str) 34 #define QgsDebugMsgLevel(str, level) 63 static void debug(
const QString& msg,
int debuglevel = 1,
const char* file =
nullptr,
const char*
function =
nullptr,
int line = -1 );
66 static void debug(
const QString& var,
int val,
int debuglevel = 1,
const char* file =
nullptr,
const char*
function =
nullptr,
int line = -1 );
70 static void debug(
const QString& var,
double val,
int debuglevel = 1,
const char* file =
nullptr,
const char*
function =
nullptr,
int line = -1 );
74 template <
typename T>
static void debug(
const QString& var, T val,
const char* file =
nullptr,
const char*
function =
nullptr,
75 int line = -1,
int debuglevel = 1 )
77 std::ostringstream os;
79 debug( var, os.str().c_str(), file,
function, line, debuglevel );
83 static void warning(
const QString& msg );
86 static void critical(
const QString& msg );
89 static void fatal(
const QString& msg );
96 static void logMessageToFile(
const QString& theMessage );
106 static int sDebugLevel;
107 static int sPrefixLength;
QgsLogger is a class to print debug/warning/error messages to the console.
QgsScopeLogger(const char *file, const char *func, int line)
static void debug(const QString &msg, int debuglevel=1, const char *file=nullptr, const char *function=nullptr, int line=-1)
Goes to qDebug.
QByteArray toLocal8Bit() const
static const QString logFile()
Reads the environment variable QGIS_LOG_FILE.
static int debugLevel()
Reads the environment variable QGIS_DEBUG and converts it to int.
static void debug(const QString &var, T val, const char *file=nullptr, const char *function=nullptr, int line=-1, int debuglevel=1)
Prints out a variable/value pair for types with overloaded operator<<.