some additional reconfigurations and what not.

This commit is contained in:
rapturate
2026-06-03 16:58:14 -04:00
parent d445744ac6
commit 03a826a71c
5 changed files with 1062 additions and 3 deletions

3
.gitignore vendored
View File

@@ -19,6 +19,7 @@ generated/
*.dylib
*.dll
*.exe
parselog_cli
# ==========================================
# Language Server & IDE Support (Arch Linux / Dev Tools)
@@ -40,4 +41,4 @@ compile_commands.json
# ==========================================
# If you download large MaxMind .mmdb files, ignore them so they don't bloat Git
*.mmdb
*.log
*.log

58
CMakeLists.txt Normal file
View File

@@ -0,0 +1,58 @@
cmake_minimum_required(VERSION 3.15)
project(ParseLogCLI LANGUAGES CXX)
# System and compiler configurations
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# ==========================================
# 1. CORE LIBRARY TARGET
# ==========================================
# Compiles your core logic files into a shared library module
add_library(parselog_core
log_parsing/log_parsing.cpp
ip_to_geo/ip_to_geo.cpp
third_party/src/GeoLite2PP.cpp
third_party/src/GeoLite2PP_error_category.cpp
)
# Include paths for your modules and MaxMind headers
target_include_directories(parselog_core PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/log_parsing
${CMAKE_CURRENT_SOURCE_DIR}/ip_to_geo
${CMAKE_CURRENT_SOURCE_DIR}/third_party/include
)
# Link the static third-party MaxMind binary
target_link_libraries(parselog_core PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib/libmaxminddb.a
)
# Version definitions needed by your GeoLite2PP wrapper
target_compile_definitions(parselog_core PRIVATE
GEOLITE2PP_VERSION="0.0.1"
)
# ==========================================
# 2. APPLICATION EXECUTABLE
# ==========================================
# Compiles your main user-facing CLI binary
add_executable(parselog_cli main.cpp)
target_link_libraries(parselog_cli PRIVATE parselog_core)
set_target_properties(parselog_cli PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
# ==========================================
# 3. TEST SUITE
# ==========================================
# Activates the built-in CTest engine
enable_testing()
# add_executable(parselog_test tests.cpp)
# target_link_libraries(parselog_test PRIVATE parselog_core)
# Registers the testing executable under the "RunAllTests" banner
# add_test(NAME RunAllTests COMMAND parselog_test)

View File

@@ -6,7 +6,7 @@
#include <regex>
#include "log_parsing.hpp"
#include "ip_to_geo.hpp"
//#include "../ip_to_geo/ip_to_geo.hpp"
p_logs::p_logs(std::string log_path) {

View File

@@ -2,7 +2,7 @@
#include "ip_to_geo/ip_to_geo.hpp"
#include <iostream>
int main(){
p_logs logs("C:\\Users\\lewis\\Desktop\\Code\\parselog_cli\\test_logs\\access.log");
p_logs logs("test_logs/access.log.txt");
logs.print_logs();
std::string ip = "69.132.83.110";

1000
test_logs/access.log.txt Normal file

File diff suppressed because it is too large Load Diff