From 19898abd57b6aa50b982eccca990f5c4271c6965 Mon Sep 17 00:00:00 2001 From: rapturate Date: Wed, 3 Jun 2026 15:59:12 -0400 Subject: [PATCH] Created a .gitignore --- .gitignore | 43 +++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 3 +++ log_parsing/log_parsing.cpp | 1 + main.cpp | 5 +++-- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..25646d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# CMake and Build Directories +# Ignores all variation of build folders (build, build_ninja, build-release, etc.) +[Bb]uild*/ +cmake-build-*/ + +# Ignore CMake generated artifacts if they accidentally land in the root +CMakeCache.txt +CMakeFiles/ +CMakeSettings.json +CMakeUserPresets.json +generated/ + +# Ignore generic compiled outputs +*.o +*.obj +*.a +*.lib +*.so +*.dylib +*.dll +*.exe + +# ========================================== +# Language Server & IDE Support (Arch Linux / Dev Tools) +# ========================================== +# Compiled commands file generated by set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +# (Your LSP uses this, but it is regenerated per-machine and shouldn't be committed) +compile_commands.json + +# Text editors and IDEs +.vscode/ +.idea/ +*.swp +*~ +.clangd/ +.cache/ + +# ========================================== +# Databases and Logs (Specific to your project) +# ========================================== +# If you download large MaxMind .mmdb files, ignore them so they don't bloat Git +*.mmdb +*.log diff --git a/CMakeLists.txt b/CMakeLists.txt index 549dee6..896bb12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,9 @@ add_executable(parselog_cli third_party/src/GeoLite2PP_error_category.cpp ) +enable_testing() +add_test(NAME LogParser COMMAND parselog_cli) + target_include_directories(parselog_cli PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/log_parsing ${CMAKE_CURRENT_SOURCE_DIR}/ip_to_geo diff --git a/log_parsing/log_parsing.cpp b/log_parsing/log_parsing.cpp index 04153fd..02f7943 100644 --- a/log_parsing/log_parsing.cpp +++ b/log_parsing/log_parsing.cpp @@ -6,6 +6,7 @@ #include #include "log_parsing.hpp" +#include "ip_to_geo.hpp" p_logs::p_logs(std::string log_path) { diff --git a/main.cpp b/main.cpp index 4c789a1..e224466 100644 --- a/main.cpp +++ b/main.cpp @@ -2,8 +2,9 @@ #include "ip_to_geo/ip_to_geo.hpp" #include int main(){ - // p_logs logs("C:\\Users\\lewis\\Desktop\\Code\\parselog_cli\\test_logs\\access.log"); - // logs.print_logs(); + p_logs logs("C:\\Users\\lewis\\Desktop\\Code\\parselog_cli\\test_logs\\access.log"); + logs.print_logs(); + std::string ip = "69.132.83.110"; std::cout << iplookup(ip);