Add comp architecture (#2968)

This commit is contained in:
Kyle Grammer 2018-01-10 22:19:08 -05:00 committed by Zach H
parent c8122c94ef
commit 6fc1aaef90
4 changed files with 83 additions and 33 deletions

View file

@ -7,38 +7,55 @@
#include <QString>
#include <QMutex>
class Logger : public QObject {
Q_OBJECT
public:
static Logger& getInstance()
{
static Logger instance;
return instance;
}
private:
Logger();
~Logger();
// Singleton - Don't implement copy constructor and assign operator
Logger(Logger const&);
void operator=(Logger const&);
#if defined(Q_PROCESSOR_X86_32)
#define BUILD_ARCHITECTURE "32-bit"
#elif defined(Q_PROCESSOR_X86_64)
#define BUILD_ARCHITECTURE "64-bit"
#elif defined(Q_PROCESSOR_ARM)
#define BUILD_ARCHITECTURE "ARM"
#else
#define BUILD_ARCHITECTURE "unknown"
#endif
bool logToFileEnabled;
QTextStream fileStream;
QFile fileHandle;
QList<QString> logBuffer;
QMutex mutex;
public:
void logToFile(bool enabled);
void log(QtMsgType type, const QMessageLogContext &ctx, const QString message);
QString getClientVersion();
QList<QString> getLogBuffer() { return logBuffer; }
protected:
void openLogfileSession();
void closeLogfileSession();
protected slots:
void internalLog(const QString message);
signals:
void logEntryAdded(QString message);
class Logger : public QObject
{
Q_OBJECT
public:
static Logger& getInstance()
{
static Logger instance;
return instance;
}
void logToFile(bool enabled);
void log(QtMsgType type, const QMessageLogContext &ctx, const QString message);
QString getClientVersion();
QString getClientOperatingSystem();
QString getSystemArchitecture();
QList<QString> getLogBuffer() { return logBuffer; }
private:
Logger();
~Logger();
// Singleton - Don't implement copy constructor and assign operator
Logger(Logger const&);
void operator=(Logger const&);
bool logToFileEnabled;
QTextStream fileStream;
QFile fileHandle;
QList<QString> logBuffer;
QMutex mutex;
protected:
void openLogfileSession();
void closeLogfileSession();
protected slots:
void internalLog(const QString message);
signals:
void logEntryAdded(QString message);
};
#endif