diff --git a/log_parsing/log_parsing.cpp b/log_parsing/log_parsing.cpp index 7297aa1..b0e5c02 100644 --- a/log_parsing/log_parsing.cpp +++ b/log_parsing/log_parsing.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "log_parsing.hpp" @@ -91,8 +92,8 @@ std::string p_logs::entryx_browser(int x){ // TO DO: TIME THE DIFFERENCE BETWEEN THESE TWO PRINTING METHODS void p_logs::print_logs() { - - // Simple printing + + std::ios_base::sync_with_stdio(false); for (const auto& log : logs) { std::cout << "IP: " << log.ip.c_str() << "\n" << "Timestamp: " << log.timestamp.c_str() << "\n" @@ -105,27 +106,5 @@ void p_logs::print_logs() { << "-----------------------------\n\n"; } - - // Faster Printing? - for (const auto& log : logs) { - std::printf( - "IP: %s\n" - "Timestamp: %s\n" - "Request: %s\n" - "Status: %s\n" - "Bytes: %s\n" - "Referer: %s\n" - "OS: %s\n" - "Browser: %s\n\n" - "-----------------------------\n\n", - log.ip.c_str(), - log.timestamp.c_str(), - log.request.c_str(), - log.status.c_str(), - log.bytes.c_str(), - log.referer.c_str(), - log.os.c_str(), - log.browser.c_str() - ); - } + std::cout.flush(); } \ No newline at end of file diff --git a/parselog_cli.exe b/parselog_cli.exe index db181ab..1c6ad53 100644 Binary files a/parselog_cli.exe and b/parselog_cli.exe differ