diff options
| author | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-03-19 09:32:58 +0000 |
|---|---|---|
| committer | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-03-19 09:32:58 +0000 |
| commit | 9d18830ee2a6b7bca3ceb8aad9c0f0753774f153 (patch) | |
| tree | 5a4dbce282838cc5a498237beb2f4f3bc4aa78dc /source | |
| parent | 3219e12750f46d693375f682136fc364fa99a92e (diff) | |
| download | qxmpp-9d18830ee2a6b7bca3ceb8aad9c0f0753774f153.tar.gz | |
Better QXmppLogger::LoggingType enums and obsoleted the older ones
Diffstat (limited to 'source')
| -rw-r--r-- | source/QXmppLogger.cpp | 10 | ||||
| -rw-r--r-- | source/QXmppLogger.h | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/source/QXmppLogger.cpp b/source/QXmppLogger.cpp index d67ff047..3d8a327e 100644 --- a/source/QXmppLogger.cpp +++ b/source/QXmppLogger.cpp @@ -51,7 +51,7 @@ static const char *typeName(QXmppLogger::MessageType type) } QXmppLogger::QXmppLogger(QObject *parent) - : QObject(parent), m_loggingType(QXmppLogger::NONE), + : QObject(parent), m_loggingType(QXmppLogger::NoLogging), m_logFilePath("QXmppClientLog.log") { } @@ -61,7 +61,7 @@ QXmppLogger* QXmppLogger::getLogger() if(!m_logger) { m_logger = new QXmppLogger(); - m_logger->setLoggingType(FILE); + m_logger->setLoggingType(FileLogging); } return m_logger; @@ -81,7 +81,7 @@ void QXmppLogger::log(QXmppLogger::MessageType type, const QString& str) { switch(m_loggingType) { - case QXmppLogger::FILE: + case QXmppLogger::FileLogging: { QFile file(m_logFilePath); file.open(QIODevice::Append); @@ -91,10 +91,10 @@ void QXmppLogger::log(QXmppLogger::MessageType type, const QString& str) str << "\n\n"; } break; - case QXmppLogger::STDOUT: + case QXmppLogger::StdoutLogging: std::cout << typeName(type) << " " << qPrintable(str) << std::endl; break; - case QXmppLogger::SIGNAL: + case QXmppLogger::SignalLogging: emit message(type, str); break; default: diff --git a/source/QXmppLogger.h b/source/QXmppLogger.h index 0629e1fe..1526e657 100644 --- a/source/QXmppLogger.h +++ b/source/QXmppLogger.h @@ -34,10 +34,14 @@ class QXmppLogger : public QObject public: enum LoggingType { - NONE = 0, ///< Log messages are discarded - FILE, ///< Log messages are written to a file - STDOUT, ///< Log messages are written to the standard output - SIGNAL, ///< Log messages are emitted as a signal + NONE = 0, ///< DEPRECATED Log messages are discarded + FILE, ///< DEPRECATED Log messages are written to a file + STDOUT, ///< DEPRECATED Log messages are written to the standard output + + NoLogging = 0, ///< Log messages are discarded + FileLogging, ///< Log messages are written to a file + StdoutLogging, ///< Log messages are written to the standard output + SignalLogging ///< Log messages are emitted as a signal }; enum MessageType |
