mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 18:25:42 +08:00
#31 Squashed merge of commits relating to the plugin system and IContext redesign, from the 'interconnect' branch.
This commit is contained in:
@@ -6,41 +6,40 @@
|
||||
#ifndef LOGMESSAGE_H
|
||||
#define LOGMESSAGE_H
|
||||
|
||||
// Qt includes
|
||||
|
||||
#include <QTextStream>
|
||||
|
||||
#include "blackmisc/context.h"
|
||||
#include "blackmisc/log.h"
|
||||
#include "blackmisc/context.h"
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
class CDebug;
|
||||
|
||||
class CLogMessage
|
||||
{
|
||||
struct LogStream {
|
||||
|
||||
//! Constructor
|
||||
struct LogStream
|
||||
{
|
||||
//! Constructor
|
||||
LogStream(CLog::TLogType type);
|
||||
|
||||
|
||||
|
||||
QTextStream output;
|
||||
|
||||
//! Message Buffer
|
||||
|
||||
//! Message Buffer
|
||||
QString buffer;
|
||||
|
||||
//! Logging type
|
||||
|
||||
//! Logging type
|
||||
CLog::TLogType type;
|
||||
bool needSpace;
|
||||
bool enableOutput;
|
||||
|
||||
//! Reference count
|
||||
quint32 reference;
|
||||
//! Reference count
|
||||
quint32 reference;
|
||||
} *logStream;
|
||||
|
||||
CDebug &debug;
|
||||
|
||||
} *logStream;
|
||||
|
||||
public:
|
||||
CLogMessage( CLog::TLogType type );
|
||||
CLogMessage(const CLogMessage &other);
|
||||
CLogMessage(CDebug &debug_, CLog::TLogType type);
|
||||
CLogMessage(const CLogMessage &other);
|
||||
|
||||
~CLogMessage();
|
||||
|
||||
@@ -57,25 +56,19 @@ namespace BlackMisc
|
||||
inline CLogMessage &operator<<(signed long t) { logStream->output << t; return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(unsigned long t) { logStream->output << t; return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(qint64 t)
|
||||
{ logStream->output << QString::number(t); return maybeSpace(); }
|
||||
{ logStream->output << QString::number(t); return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(quint64 t)
|
||||
{ logStream->output << QString::number(t); return maybeSpace(); }
|
||||
{ logStream->output << QString::number(t); return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(float t) { logStream->output << t; return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(double t) { logStream->output << t; return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(const char* t) { logStream->output << QString::fromAscii(t); return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(const QString & t) { logStream->output << '\"' << t << '\"'; return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(const QByteArray & t) { logStream->output << '\"' << t << '\"'; return maybeSpace(); }
|
||||
|
||||
static CLogMessage getWarningMsgObj() { return CLogMessage(CLog::WARNING); }
|
||||
static CLogMessage getInfoMsgObj() { return CLogMessage(CLog::INFO); }
|
||||
static CLogMessage getDebugMsgObj() { return CLogMessage(CLog::DEBUG); }
|
||||
static CLogMessage getErrorMsgObj() { return CLogMessage(CLog::ERROR); }
|
||||
static CLogMessage getAssertMsgObj() { return CLogMessage(CLog::ASSERT); }
|
||||
inline CLogMessage &operator<<(const char *t) { logStream->output << QString::fromAscii(t); return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(const QString &t) { logStream->output << '\"' << t << '\"'; return maybeSpace(); }
|
||||
inline CLogMessage &operator<<(const QByteArray &t) { logStream->output << '\"' << t << '\"'; return maybeSpace(); }
|
||||
|
||||
inline CLogMessage &operator<<(QTextStreamManipulator m)
|
||||
{ logStream->output << m; return *this; }
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // BlackMisc
|
||||
|
||||
Reference in New Issue
Block a user