修改文件换行符,修正轮班图元长度计算问题

This commit is contained in:
2026-08-19 11:55:10 +08:00
parent 176b53b654
commit a274b75705
116 changed files with 68711 additions and 68660 deletions
+76 -76
View File
@@ -1,76 +1,76 @@
#ifndef LOGGER_H
#define LOGGER_H
#include <QtGlobal>
#include <QThreadStorage>
#include <QHash>
#include <QStringList>
#include <QMutex>
#include <QObject>
#include "logglobal.h"
#include "logmessage.h"
#include <QDebug>
class DECLSPEC Logger : public QObject {
Q_OBJECT
Q_DISABLE_COPY(Logger)
public:
Logger(QObject* parent);
Logger(const QString msgFormat="{timestamp} {type} {msg}",
const QString timestampFormat="dd.MM.yyyy hh:mm:ss.zzz",
const QtMsgType minLevel=QtDebugMsg, const int bufferSize=0,
QObject* parent = nullptr);
virtual ~Logger();
virtual void log(const QtMsgType type, const QString& message, const QString &file="",
const QString &function="", const int line=0);
void installMsgHandler();
static void set(const QString& name, const QString& value);
virtual void clear(const bool buffer=true, const bool variables=true);
protected:
QString msgFormat;
QString timestampFormat;
QtMsgType minLevel;
int bufferSize;
static QMutex mutex;
virtual void write(const LogMessage* logMessage);
private:
static Logger* defaultLogger;
static void msgHandler(const QtMsgType type, const QString &message, const QString &file="",
const QString &function="", const int line=0);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
static void msgHandler5(const QtMsgType type, const QMessageLogContext& context, const QString &message);
#else
static void msgHandler4(const QtMsgType type, const char * message);
#endif
static QThreadStorage<QHash<QString,QString>*> logVars;
QThreadStorage<QList<LogMessage*>*> buffers;
};
#endif // LOGGER_H
#ifndef LOGGER_H
#define LOGGER_H
#include <QtGlobal>
#include <QThreadStorage>
#include <QHash>
#include <QStringList>
#include <QMutex>
#include <QObject>
#include "logglobal.h"
#include "logmessage.h"
#include <QDebug>
class DECLSPEC Logger : public QObject {
Q_OBJECT
Q_DISABLE_COPY(Logger)
public:
Logger(QObject* parent);
Logger(const QString msgFormat="{timestamp} {type} {msg}",
const QString timestampFormat="dd.MM.yyyy hh:mm:ss.zzz",
const QtMsgType minLevel=QtDebugMsg, const int bufferSize=0,
QObject* parent = nullptr);
virtual ~Logger();
virtual void log(const QtMsgType type, const QString& message, const QString &file="",
const QString &function="", const int line=0);
void installMsgHandler();
static void set(const QString& name, const QString& value);
virtual void clear(const bool buffer=true, const bool variables=true);
protected:
QString msgFormat;
QString timestampFormat;
QtMsgType minLevel;
int bufferSize;
static QMutex mutex;
virtual void write(const LogMessage* logMessage);
private:
static Logger* defaultLogger;
static void msgHandler(const QtMsgType type, const QString &message, const QString &file="",
const QString &function="", const int line=0);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
static void msgHandler5(const QtMsgType type, const QMessageLogContext& context, const QString &message);
#else
static void msgHandler4(const QtMsgType type, const char * message);
#endif
static QThreadStorage<QHash<QString,QString>*> logVars;
QThreadStorage<QList<LogMessage*>*> buffers;
};
#endif // LOGGER_H