Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
朱子楚\zhuzi committed Dec 4, 2023
1 parent b4f2f68 commit 46148b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions example/src/helper/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <QtCore/qfile.h>
#include <QtCore/qtextstream.h>
#include <iostream>
#include <framelesshelpercore_global.h>

#ifndef QT_ENDL
# if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
Expand Down Expand Up @@ -35,7 +34,7 @@ static inline void myMessageHandler(const QtMsgType type, const QMessageLogConte
}
if (!g_logFile) {
g_logFile = std::make_unique<QFile>();
g_logFile->setFileName(FRAMELESSHELPER_STRING_LITERAL("debug-%1.log").arg(g_app));
g_logFile->setFileName(QString("debug-%1.log").arg(g_app));
if (!g_logFile->open(QFile::WriteOnly | QFile::Text | QFile::Append)) {
std::cerr << "Can't open file to write: " << qUtf8Printable(g_logFile->errorString()) << std::endl;
g_logFile.reset();
Expand All @@ -62,7 +61,7 @@ void Log::setup(const QString &app)
}
once = true;
g_app = app;
qSetMessagePattern(FRAMELESSHELPER_STRING_LITERAL(
qSetMessagePattern(QString(
"[%{time yyyy/MM/dd hh:mm:ss.zzz}] <%{if-info}INFO%{endif}%{if-debug}DEBUG"
"%{endif}%{if-warning}WARNING%{endif}%{if-critical}CRITICAL%{endif}%{if-fatal}"
"FATAL%{endif}> %{if-category}%{category}: %{endif}%{message}"));
Expand Down

0 comments on commit 46148b3

Please sign in to comment.