feat: log pattern should be different at release mode
This commit is contained in:
parent
4e0db9ef4b
commit
0f0b10586f
14
src/main.cpp
14
src/main.cpp
@ -50,16 +50,20 @@ auto main(int argc, char* argv[]) -> int {
|
|||||||
argc, argv);
|
argc, argv);
|
||||||
ctx->InitApplication();
|
ctx->InitApplication();
|
||||||
|
|
||||||
|
#ifdef RELEASE
|
||||||
|
QLoggingCategory::setFilterRules("*.debug=false\n*.info=false\n");
|
||||||
|
qSetMessagePattern(
|
||||||
|
"[%{time yyyyMMdd h:mm:ss.zzz}] [%{category}] "
|
||||||
|
"[%{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-"
|
||||||
|
"critical}C%{endif}%{if-fatal}F%{endif}] [%{threadid}] - "
|
||||||
|
"%{message}");
|
||||||
|
#else
|
||||||
|
QLoggingCategory::setFilterRules("*.debug=false");
|
||||||
qSetMessagePattern(
|
qSetMessagePattern(
|
||||||
"[%{time yyyyMMdd h:mm:ss.zzz}] [%{category}] "
|
"[%{time yyyyMMdd h:mm:ss.zzz}] [%{category}] "
|
||||||
"[%{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-"
|
"[%{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-"
|
||||||
"critical}C%{endif}%{if-fatal}F%{endif}] [%{threadid}] %{file}:%{line} - "
|
"critical}C%{endif}%{if-fatal}F%{endif}] [%{threadid}] %{file}:%{line} - "
|
||||||
"%{message}");
|
"%{message}");
|
||||||
|
|
||||||
#ifdef RELEASE
|
|
||||||
QLoggingCategory::setFilterRules("*.debug=false\n*.info=false\n");
|
|
||||||
#else
|
|
||||||
QLoggingCategory::setFilterRules("*.debug=false");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto rtn = 0;
|
auto rtn = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user