WebpagePrinterTool 2.0
Print a web page skip the browser's print preview
载入中...
搜索中...
未找到
log.h
浏览该文件的文档.
1#ifndef LOG_H
2#define LOG_H
3
4#include <QDateTime>
5#include <QFile>
6#include <QLoggingCategory>
7#include <QMessageLogContext>
8#include <QMutex>
9#include <QTextStream>
10// ------------------- 日志分类声明 -------------------
11// NOLINTBEGIN(readability-identifier-naming)
12Q_DECLARE_LOGGING_CATEGORY(APPLOG)
13// NOLINTEND(readability-identifier-naming)
14
15
21 public:
22 static void init(const QString& filePath, qint64 maxSizeBytes);
23
24 private:
25 static inline QFile log_file;
26 static inline QMutex mutex;
27 static inline QString log_file_path;
28 static inline qint64 max_size = 5 * 1024 * 1024;
29
30 static void openLogFile();
34 static void rotateLogFileIfNeeded();
44 static void messageHandler(QtMsgType type, const QMessageLogContext& context,
45 const QString& msg);
46};
47#endif // LOG_H
定义 log.h:20
static void rotateLogFileIfNeeded()
partition logs into several log files
定义 log.cpp:16
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
Reprocessing message for add file name,line number etc. when in relase mode , add_definitions(-DQT_ME...
定义 log.cpp:32
static QMutex mutex
定义 log.h:26
static void init(const QString &filePath, qint64 maxSizeBytes)
定义 log.cpp:3
static qint64 max_size
定义 log.h:28
static void openLogFile()
定义 log.cpp:9
static QString log_file_path
定义 log.h:27
static QFile log_file
定义 log.h:25