mirror of
https://github.com/mchernigin/libqbase.git
synced 2025-01-03 13:17:41 +03:00
feat: example project
This commit is contained in:
parent
77ffc2ebd2
commit
8433e370e5
10
example/CMakeLists.txt
Normal file
10
example/CMakeLists.txt
Normal 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
16
example/main.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user