From 3f1c264818af42a3c21111d4171ba046d5740360 Mon Sep 17 00:00:00 2001 From: mrbesen Date: Wed, 26 Oct 2022 22:01:03 +0200 Subject: [PATCH] use new logger version with qt support --- .gitmodules | 2 +- lolautoaccept.pro | 1 + src/main.cpp | 9 +++++---- thirdparty/Log | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitmodules b/.gitmodules index b344412..c8bc831 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "thirdparty/Log"] path = thirdparty/Log - url = https://git.okaestne.de/okaestne/Log.git \ No newline at end of file + url = https://git.mrbesen.de/MrBesen/Log.git diff --git a/lolautoaccept.pro b/lolautoaccept.pro index 86e1238..c7db5df 100644 --- a/lolautoaccept.pro +++ b/lolautoaccept.pro @@ -14,6 +14,7 @@ unix:LIBS += -lcurl -pthread -lrt # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS +DEFINES += LOG_ENABLEQT=1 # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. diff --git a/src/main.cpp b/src/main.cpp index dbd47ca..61c6587 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ #include #include +#include #include "arg.h" #include "mainwindow.h" @@ -25,18 +26,18 @@ int main(int argc, char** argv) { if(args.debugLog) { Log::setConsoleLogLevel(Log::Level::trace); Log::addLogfile("log.txt", Log::Level::trace); - Log::debug << "debug Log enabled"; + qDebug() << "debug Log enabled"; } - Log::info << "Hello, World!"; - Log::note << "Using Locale: " << QLocale().name().toStdString(); + qInfo() << "Hello, World!"; + qInfo() << "Using Locale: " << QLocale().name().toStdString(); QApplication app(argc, argv); QTranslator translator; if(translator.load(QLocale().name(), ":/ts")) { app.installTranslator(&translator); } else { - Log::warn << "translation not found"; + qWarning() << "translation not found"; } MainWindow win; QIcon icon(":/lolautoaccept.png"); diff --git a/thirdparty/Log b/thirdparty/Log index e1475e7..9a43d50 160000 --- a/thirdparty/Log +++ b/thirdparty/Log @@ -1 +1 @@ -Subproject commit e1475e798e2429d171b8f58fc3c96c81db25639c +Subproject commit 9a43d50969ecc34d9a3bc8944bc2182e55f7a712