scaffold some common services
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
project(accordion-client LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
add_executable(accordion-client
|
||||
src/main.cpp
|
||||
# other client source files go here
|
||||
)
|
||||
|
||||
message(STATUS ${ROOT_DIR})
|
||||
|
||||
target_include_directories(accordion-client PRIVATE
|
||||
${ROOT_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(accordion-client PRIVATE
|
||||
accordion-common
|
||||
)
|
||||
|
||||
21
client/config/main.cfg
Normal file
21
client/config/main.cfg
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
Logger = (
|
||||
{
|
||||
Id = "main";
|
||||
|
||||
FlagsEnabled = (
|
||||
"Debug",
|
||||
"Info",
|
||||
"Warning",
|
||||
"Error"
|
||||
);
|
||||
|
||||
ShowTime = false;
|
||||
ShowSourceTrace = false;
|
||||
CoutEnabled = true;
|
||||
|
||||
FileEnabled = true;
|
||||
FilePath = "build/client/logs";
|
||||
FileName = "app.log";
|
||||
}
|
||||
);
|
||||
0
client/src/App.cpp
Normal file
0
client/src/App.cpp
Normal file
0
client/src/App.hpp
Normal file
0
client/src/App.hpp
Normal file
@@ -1,8 +1,15 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "common/config/ConfigService.hpp"
|
||||
#include "common/config/LoggerConfig.hpp"
|
||||
#include "common/LoggerService.hpp"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
|
||||
std::cout << "hi mom from client!" << std::endl;
|
||||
ConfigService config {"client/config/main.cfg"}; // TODO: main config file should be the foremost cli argument
|
||||
LoggerService logger {&config, "main"};
|
||||
|
||||
logger.log("main", LogFlag::Debug, "hello world from the client!");
|
||||
|
||||
}
|
||||
|
||||
0
client/test/.gitkeep
Normal file
0
client/test/.gitkeep
Normal file
Reference in New Issue
Block a user