diff --git a/.gitmodules b/.gitmodules index fff2eb1..4e704fc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "lib/src/libtins"] path = lib/src/libtins url = https://github.com/mfontanini/libtins.git +[submodule "lib/src/easyloggingpp"] + path = lib/src/easyloggingpp + url = git@github.com:easylogging/easyloggingpp.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 502ccb1..05df866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.3.2) project (121Nat) INCLUDE_DIRECTORIES(lib/src/jsoncpp/include) INCLUDE_DIRECTORIES(lib/src/libtins/include) +INCLUDE_DIRECTORIES(lib/src/easyloggingpp/src/) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(lib/src/jsoncpp) ADD_SUBDIRECTORY(lib/src/libtins) diff --git a/lib/src/easyloggingpp b/lib/src/easyloggingpp new file mode 160000 index 0000000..f926802 --- /dev/null +++ b/lib/src/easyloggingpp @@ -0,0 +1 @@ +Subproject commit f926802dfbde716d82b64b8ef3c25b7f0fcfec65 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 76a18d3..2f65964 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ file(GLOB_RECURSE 121Nat_Src_Files "*.h" "*.cpp") -add_executable(121Nat ${121Nat_Src_Files}) +add_executable(121Nat ${121Nat_Src_Files} ../lib/src/easyloggingpp/src/easylogging++.h) target_link_libraries (121Nat pthread tins jsoncpp_lib_static) diff --git a/src/main.cpp b/src/main.cpp index 731aa4c..4564fe4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,9 @@ #include #include #include +#include "easylogging++.h" + +INITIALIZE_EASYLOGGINGPP template void delete_them(Container& c) @@ -22,7 +25,7 @@ int main(int argc, char** argv) if (argc < 2){ return 0; } - + LOG(INFO) << "Hello, world"; otonat::NatMap::NatRangeList interfaceList; std::ifstream config_doc(argv[1], std::ifstream::binary); Json::Value root;