X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Flogger.h;h=07ae0156d15cb59c3d8af562c1c46c5cac41b34e;hp=d9f935ccec738384ea474231805d3a4d8f71e9dc;hb=dadcc49b8d790d4913478e08978da2718bd6f048;hpb=0d66a6f9ed6ea90493bca69ff781a1131d981503 diff --git a/src/common/logger.h b/src/common/logger.h index d9f935cc..07ae0156 100644 --- a/src/common/logger.h +++ b/src/common/logger.h @@ -36,34 +36,34 @@ class Logger { ErrorLevel }; - inline Logger(LogLevel level) : stream(new Stream(level)) {} + inline Logger(LogLevel level) : _stream(new Stream(level)) {} ~Logger(); - inline Logger &operator<<(const char* t) { stream->internalStream << QString::fromAscii(t); return *this; } - inline Logger &operator<<(QChar t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(bool t) { stream->internalStream << (t ? "true" : "false"); return *this; } - inline Logger &operator<<(char t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(signed short t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(unsigned short t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(signed int t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(unsigned int t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(signed long t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(unsigned long t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(qint64 t) { stream->internalStream << QString::number(t); return *this; } - inline Logger &operator<<(quint64 t) { stream->internalStream << QString::number(t); return *this; } - inline Logger &operator<<(float t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(double t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(const QString & t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(const QLatin1String &t) { stream->internalStream << t.latin1(); return *this; } - inline Logger &operator<<(const QByteArray & t) { stream->internalStream << t ; return *this; } - inline Logger &operator<<(const void * t) { stream->internalStream << t; return *this; } - inline Logger &operator<<(const QStringList & t) { stream->internalStream << t.join(" "); return *this; } - inline Logger &operator<<(const BufferId & t) { stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } - inline Logger &operator<<(const NetworkId & t) { stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } - inline Logger &operator<<(const UserId & t) { stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } - inline Logger &operator<<(const MsgId & t) { stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } - inline Logger &operator<<(const IdentityId & t) { stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } - inline Logger &operator<<(const AccountId & t) { stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } + inline Logger &operator<<(const char* t) { _stream->internalStream << QString::fromAscii(t); return *this; } + inline Logger &operator<<(QChar t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(bool t) { _stream->internalStream << (t ? "true" : "false"); return *this; } + inline Logger &operator<<(char t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(signed short t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(unsigned short t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(signed int t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(unsigned int t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(signed long t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(unsigned long t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(qint64 t) { _stream->internalStream << QString::number(t); return *this; } + inline Logger &operator<<(quint64 t) { _stream->internalStream << QString::number(t); return *this; } + inline Logger &operator<<(float t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(double t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(const QString & t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(const QLatin1String &t) { _stream->internalStream << t.latin1(); return *this; } + inline Logger &operator<<(const QByteArray & t) { _stream->internalStream << t ; return *this; } + inline Logger &operator<<(const void * t) { _stream->internalStream << t; return *this; } + inline Logger &operator<<(const QStringList & t) { _stream->internalStream << t.join(" "); return *this; } + inline Logger &operator<<(const BufferId & t) { _stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } + inline Logger &operator<<(const NetworkId & t) { _stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } + inline Logger &operator<<(const UserId & t) { _stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } + inline Logger &operator<<(const MsgId & t) { _stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } + inline Logger &operator<<(const IdentityId & t) { _stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } + inline Logger &operator<<(const AccountId & t) { _stream->internalStream << QVariant::fromValue(t).toInt(); return *this; } void log(); private: @@ -74,7 +74,7 @@ class Logger { QTextStream internalStream; QString buffer; LogLevel logLevel; - } *stream; + } *_stream; }; inline Logger quDebug() { return Logger(Logger::DebugLevel); }