mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Improve the logging message pattern
Add the log level and category name in the output. Only output the thread ID and function name for qCDebug statements as they are not necessary for general use and make the log harder to read. Also make sure that the message pattern is set when NO_MSG_HANDLER is used. Using an environment variable should have priority over it anyway.
This commit is contained in:
parent
e10a08f64d
commit
3a193655b3
1 changed files with 2 additions and 2 deletions
|
@ -67,10 +67,10 @@ Logger *Logger::instance()
|
||||||
Logger::Logger( QObject* parent) : QObject(parent),
|
Logger::Logger( QObject* parent) : QObject(parent),
|
||||||
_showTime(true), _logWindowActivated(false), _doFileFlush(false), _logExpire(0)
|
_showTime(true), _logWindowActivated(false), _doFileFlush(false), _logExpire(0)
|
||||||
{
|
{
|
||||||
#ifndef NO_MSG_HANDLER
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
||||||
qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} %{threadid} %{function}: %{message}");
|
qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} [ %{type} %{category} ]%{if-debug}\t[ %{function} ]%{endif}:\t%{message}");
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef NO_MSG_HANDLER
|
||||||
qInstallMessageHandler(mirallLogCatcher);
|
qInstallMessageHandler(mirallLogCatcher);
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(mirallLogCatcher)
|
Q_UNUSED(mirallLogCatcher)
|
||||||
|
|
Loading…
Reference in a new issue