libqbase/example/main.cpp

20 lines
573 B
C++
Raw Normal View History

2023-09-15 11:08:57 +03:00
#include <baselib/logger/prelude.h>
#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
auto loggerManager = base::logger::LoggerManager::globalInstance();
loggerManager->addLogger<base::logger::ConsoleLogger>(QtDebugMsg);
loggerManager->addLogger<base::logger::FileLogger>(QtWarningMsg, "appname", "appname.log");
loggerManager->addLogger<base::logger::SyslogLogger>(LOG_LEVEL_DISABLED, "appname");
2023-09-15 11:08:57 +03:00
qDebug() << "Hello?";
qInfo() << "Hello?";
2023-09-15 11:08:57 +03:00
qWarning() << "Hello?";
qCritical() << "Hello?";
2023-09-15 11:08:57 +03:00
return 0;
}