mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
Add comp architecture (#2968)
This commit is contained in:
parent
c8122c94ef
commit
6fc1aaef90
4 changed files with 83 additions and 33 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue