Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
Logger Class Reference

#include <logger.h>

Inheritance diagram for Logger:
[legend]
Collaboration diagram for Logger:
[legend]

Signals

void logEntryAdded (const QString &message)

Public Member Functions

void logToFile (bool enabled)
void log (QtMsgType type, const QMessageLogContext &ctx, const QString &message)
QString getClientVersion ()
QString getClientOperatingSystem ()
QString getSystemArchitecture ()
QString getSystemLocale ()
QString getClientInstallInfo ()
QList< QString > getLogBuffer ()
void setPersistentLogPath (const QString &path)
QList< QString > getPreviousSessionTail (int maxLines=60) const

Static Public Member Functions

static Logger & getInstance ()
static QList< QString > extractPreviousSessionTail (const QString &filePath, int maxLines=60)

Protected Slots

void internalLog (const QString &message)

Protected Member Functions

void openLogfileSession ()
void closeLogfileSession ()
void openPersistentLog (const QString &path)
void prunePersistentLog (const QString &path)
void closePersistentLogSession ()

Private Member Functions

 Logger ()
 ~Logger () override
 Logger (Logger const &)
void operator= (Logger const &)

Private Attributes

bool logToFileEnabled
QTextStream fileStream
QFile fileHandle
QList< QString > logBuffer
QMutex mutex
QString persistentLogPath
bool persistentLogEnabled
QTextStream persistentFileStream
QFile persistentFileHandle

Constructor & Destructor Documentation

◆ Logger() [1/2]

Logger::Logger ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Logger()

Logger::~Logger ( )
overrideprivate
Here is the call graph for this function:

◆ Logger() [2/2]

Logger::Logger ( Logger const & )
private
Here is the call graph for this function:

Member Function Documentation

◆ closeLogfileSession()

void Logger::closeLogfileSession ( )
protected
Here is the caller graph for this function:

◆ closePersistentLogSession()

void Logger::closePersistentLogSession ( )
protected
Here is the caller graph for this function:

◆ extractPreviousSessionTail()

QList< QString > Logger::extractPreviousSessionTail ( const QString & filePath,
int maxLines = 60 )
static
Here is the caller graph for this function:

◆ getClientInstallInfo()

QString Logger::getClientInstallInfo ( )
Here is the caller graph for this function:

◆ getClientOperatingSystem()

QString Logger::getClientOperatingSystem ( )
Here is the caller graph for this function:

◆ getClientVersion()

QString Logger::getClientVersion ( )
Here is the caller graph for this function:

◆ getInstance()

Logger & Logger::getInstance ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLogBuffer()

QList< QString > Logger::getLogBuffer ( )
inline
Here is the caller graph for this function:

◆ getPreviousSessionTail()

QList< QString > Logger::getPreviousSessionTail ( int maxLines = 60) const
Here is the call graph for this function:

◆ getSystemArchitecture()

QString Logger::getSystemArchitecture ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSystemLocale()

QString Logger::getSystemLocale ( )
Here is the caller graph for this function:

◆ internalLog

void Logger::internalLog ( const QString & message)
protectedslot
Here is the call graph for this function:

◆ log()

void Logger::log ( QtMsgType type,
const QMessageLogContext & ctx,
const QString & message )
Here is the caller graph for this function:

◆ logEntryAdded

void Logger::logEntryAdded ( const QString & message)
signal
Here is the caller graph for this function:

◆ logToFile()

void Logger::logToFile ( bool enabled)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openLogfileSession()

void Logger::openLogfileSession ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openPersistentLog()

void Logger::openPersistentLog ( const QString & path)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void Logger::operator= ( Logger const & )
private
Here is the call graph for this function:

◆ prunePersistentLog()

void Logger::prunePersistentLog ( const QString & path)
protected
Here is the caller graph for this function:

◆ setPersistentLogPath()

void Logger::setPersistentLogPath ( const QString & path)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fileHandle

QFile Logger::fileHandle
private

◆ fileStream

QTextStream Logger::fileStream
private

◆ logBuffer

QList<QString> Logger::logBuffer
private

◆ logToFileEnabled

bool Logger::logToFileEnabled
private

◆ mutex

QMutex Logger::mutex
mutableprivate

◆ persistentFileHandle

QFile Logger::persistentFileHandle
private

◆ persistentFileStream

QTextStream Logger::persistentFileStream
private

◆ persistentLogEnabled

bool Logger::persistentLogEnabled
private

◆ persistentLogPath

QString Logger::persistentLogPath
private

The documentation for this class was generated from the following files: