#include "process.h" #include #include #include "scolor.hpp" using namespace std; int main(){ process access_follower("tail -f /var/log/nginx/access.log"); process error_follower("tail -f /var/log/nginx/error.log"); process f2b_follower("tail -f /var/log/fail2ban.log"); for(int i = 0; i < 5; i++){ sleep(1); string af_output = access_follower.retrieve_output(1000); string error_output = error_follower.retrieve_output(1000); string f2b_output = f2b_follower.retrieve_output(1000); printf(DGREEN("Got output from access.log: %s\n").c_str(), af_output.c_str()); printf(DRED("Got output from error.log: %s\n").c_str(), error_output.c_str()); printf(DYELLOW("Got output from fail2ban.log: %s\n").c_str(), f2b_output.c_str()); } access_follower.stop(); error_follower.stop(); f2b_follower.stop(); return 0; }