use new logger version with qt support

This commit is contained in:
mrbesen 2022-10-26 22:01:03 +02:00
parent 49bdc60071
commit 3f1c264818
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
4 changed files with 8 additions and 6 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "thirdparty/Log"]
path = thirdparty/Log
url = https://git.okaestne.de/okaestne/Log.git
url = https://git.mrbesen.de/MrBesen/Log.git

View File

@ -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.

View File

@ -8,6 +8,7 @@
#include <QTranslator>
#include <Log.h>
#include <QDebug>
#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");

2
thirdparty/Log vendored

@ -1 +1 @@
Subproject commit e1475e798e2429d171b8f58fc3c96c81db25639c
Subproject commit 9a43d50969ecc34d9a3bc8944bc2182e55f7a712