#include "utils.h" QString getTimestampStr() { QTimeZone tz(settings.value("outputTimestamp/tz").toByteArray()); QString format(settings.value("outputTimestamp/format").toString()); return QDateTime::currentDateTimeUtc().toTimeZone(tz).toString(format); } QString getNamePrefix() { QString base(gCurrentSubjectName); if (! gCurrentSubjectName.isEmpty()) base.append("_"); base.append(getTimestampStr()); return base.append("_"); } void logMessages(QtMsgType type, const QMessageLogContext &context, const QString &msg) { static QMutex logMutex; static std::ofstream log; QMutexLocker lock(&logMutex); if (!log.is_open()) log.open("EyeRec.log", std::ofstream::app); else log << qFormatLogMessage(type, context, msg).toStdString() << std::endl; std::cout << qFormatLogMessage(type, context, msg).toStdString() << std::endl; } void initBanner() { qDebug() << "\n" << "######################################################################" << "\n" << "# " << QDateTime::currentDateTime().toString() << "\n" << "######################################################################"; } void exitBanner() { qDebug() << "[Exiting]" << QDateTime::currentDateTime().toString(); } GlobalTimer gTimer; QString gBinaryPath = ""; QString gCurrentSubjectName = ""; QString gFileIndexStr = "0000";