| 1 |
#include <QString> |
| 2 |
#include "config_msg.h" |
| 3 |
#include "doxywizard.h" |
| 4 |
|
| 5 |
static QString warning_str = QString::fromLatin1("warning: "); |
| 6 |
static QString error_str = QString::fromLatin1("error: "); |
| 7 |
|
| 8 |
void config_err(const char *fmt, ...) |
| 9 |
{ |
| 10 |
QString msg = error_str; |
| 11 |
|
| 12 |
msg.append(QString::fromLatin1(fmt)); |
| 13 |
va_list args; |
| 14 |
va_start(args, fmt); |
| 15 |
char debugOut[1000]; // this size should be sufficient |
| 16 |
vsnprintf(debugOut, 1000,qPrintable(msg), args); |
| 17 |
MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); |
| 18 |
va_end(args); |
| 19 |
} |
| 20 |
|
| 21 |
void config_term(const char *fmt, ...) |
| 22 |
{ |
| 23 |
QString msg = error_str; |
| 24 |
|
| 25 |
msg.append(QString::fromLatin1(fmt)); |
| 26 |
va_list args; |
| 27 |
va_start(args, fmt); |
| 28 |
char debugOut[1000]; // this size should be sufficient |
| 29 |
vsnprintf(debugOut, 1000,qPrintable(msg), args); |
| 30 |
MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); |
| 31 |
va_end(args); |
| 32 |
exit(1); |
| 33 |
} |
| 34 |
|
| 35 |
void config_warn(const char *fmt, ...) |
| 36 |
{ |
| 37 |
QString msg = warning_str; |
| 38 |
|
| 39 |
msg.append(QString::fromLatin1(fmt)); |
| 40 |
va_list args; |
| 41 |
va_start(args, fmt); |
| 42 |
char debugOut[1000]; |
| 43 |
vsnprintf(debugOut, 1000,qPrintable(msg), args); |
| 44 |
MainWindow::instance().outputLogText(QString::fromLatin1(debugOut)); |
| 45 |
va_end(args); |
| 46 |
} |
| 47 |
|
| 48 |
void config_open() |
| 49 |
{ |
| 50 |
MainWindow::instance().outputLogStart(); |
| 51 |
} |
| 52 |
|
| 53 |
void config_finish() |
| 54 |
{ |
| 55 |
MainWindow::instance().outputLogFinish(); |
| 56 |
} |