|
QtCanpool 3.3.0
|
Application logging built on top of Qt's message handler: the usual qDebug()/qInfo()/qWarning()/qCritical() calls are captured, formatted with a timestamp, level and category, and written to the console and/or a rotating log file. 更多...
#include <qxcore/qxlogger.h>
类 | |
| struct | Options |
Public 类型 | |
| enum | Level { Debug = 0 , Info , Warning , Critical , Fatal } |
| Level letters used in the output, in ascending severity. 更多... | |
静态 Public 成员函数 | |
| static bool | init (const Options &options=Options()) |
| Installs the message handler. | |
| static void | shutdown () |
| Flushes and uninstalls the message handler. | |
| static bool | isEnabled () |
| static QString | fileName () |
| Path of the active log file, empty when file output is disabled. | |
| static void | flush () |
| Flushes buffered output to disk. | |
| static void | write (Level level, const QString &category, const QString &message) |
| Formats and writes one message, bypassing the installed handler. | |
| static void | write (Level level, const QLoggingCategory &category, const QString &message) |
| Convenience overload that reads the name from category. | |
Application logging built on top of Qt's message handler: the usual qDebug()/qInfo()/qWarning()/qCritical() calls are captured, formatted with a timestamp, level and category, and written to the console and/or a rotating log file.
All members are static: the logger owns process-wide state, and init() must be called once before the first message is logged. shutdown() restores the previous message handler, which keeps the class usable in tests.
在文件 qxlogger.h 第 25 行定义.
Level letters used in the output, in ascending severity.
| 枚举值 | |
|---|---|
| Debug | |
| Info | |
| Warning | |
| Critical | |
| Fatal | |
在文件 qxlogger.h 第 29 行定义.
|
static |
Path of the active log file, empty when file output is disabled.
在文件 qxlogger.cpp 第 172 行定义.
|
static |
Flushes buffered output to disk.
在文件 qxlogger.cpp 第 179 行定义.
Installs the message handler.
Repeated calls replace the previous configuration; returns false when the log file cannot be opened, in which case console output is still active.
在文件 qxlogger.cpp 第 123 行定义.
|
static |
在文件 qxlogger.cpp 第 165 行定义.
|
static |
Flushes and uninstalls the message handler.
在文件 qxlogger.cpp 第 147 行定义.
|
static |
Convenience overload that reads the name from category.
在文件 qxlogger.cpp 第 188 行定义.
|
static |
Formats and writes one message, bypassing the installed handler.
在文件 qxlogger.cpp 第 193 行定义.