From 8433e370e5722518e99f114218d9309362e716b1 Mon Sep 17 00:00:00 2001 From: Michael Chernigin Date: Fri, 15 Sep 2023 12:08:57 +0400 Subject: [PATCH] feat: example project --- example/CMakeLists.txt | 10 ++++++++++ example/main.cpp | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 example/CMakeLists.txt create mode 100644 example/main.cpp diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 0000000..423d5d2 --- /dev/null +++ b/example/CMakeLists.txt @@ -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) diff --git a/example/main.cpp b/example/main.cpp new file mode 100644 index 0000000..f1bbdb6 --- /dev/null +++ b/example/main.cpp @@ -0,0 +1,16 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + auto loggerManager = base::logger::LoggerManager::globalInstance(); + + loggerManager->addLogger(QtDebugMsg); + loggerManager->addLogger(QtWarningMsg); + loggerManager->addLogger(LOG_LEVEL_DISABLED); + + qWarning() << "Hello?"; + + return 0; +}