feat: example project

This commit is contained in:
Михаил Чернигин 2023-09-15 12:08:57 +04:00
parent 77ffc2ebd2
commit 8433e370e5
Signed by: cherniginma
GPG Key ID: 42ED11B71604A422
2 changed files with 26 additions and 0 deletions

10
example/CMakeLists.txt Normal file
View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.15)
project(baselib-example LANGUAGES CXX)
find_package(Qt5 COMPONENTS Core REQUIRED)
find_package(baselib COMPONENTS logger REQUIRED)
add_executable(${PROJECT_NAME})
target_sources(${PROJECT_NAME} PRIVATE main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE baselib::logger Qt5::Core)

16
example/main.cpp Normal file
View File

@ -0,0 +1,16 @@
#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);
loggerManager->addLogger<base::logger::SyslogLogger>(LOG_LEVEL_DISABLED);
qWarning() << "Hello?";
return 0;
}