dtkcore/docs/log/ConsoleAppender.zh_CN.dox

24 lines
1.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
@~chinese
@ingroup dlog
@file include/log/ConsoleAppender.h
@class Dtk::Core::ConsoleAppender
@brief ConsoleAppender是简单的控制台appender将日志记录写入`std::cerr`输出流<br>
@details ConsoleAppender使用`[%{type:-7}] <%{function}> %{message}\n`作为默认输出格式。它类似于AbstractStringAppender,但不显示时间<br>
你可以通过使用`QT_MESSAGE_PATTERN`环境变量来修改ConsoleAppender的输出格式,而不用修改你的代码。
变量。如果你需要你的应用程序忽略这个环境变量,你可以调用`ConsoleAppender::ignoreEnvironmentPattern(true)`
@fn ConsoleAppender Dtk::Core::ConsoleAppender::ConsoleAppender()
@brief 构造函数,设置默认的日志格式为`[%{type:-7}] <%{function}> %{message}\n`
@fn virtual QString Dtk::Core::ConsoleAppender::format()
@brief 返回当前默认输出格式,可以调用父类的`setFormat()`来更改日志输出格式
@sa AbstractStringAppender::setFormat()
@fn void Dtk::Core::ConsoleAppender::ignoreEnvironmentPattern(bool ignore)
@brief 设置应用程序忽略环境变量来修改ConsoleAppender的输出格式,使用默认输出格式
@sa [QT_MESSAGE_PATTERN](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages)
*/