1 2 3 4 5 6 7 8 9 10 11 12 13
#include "util.h" #include <ctime> using namespace std; ostream& debug(ostream &os){ char buf[64]; time_t timeval=time(NULL); struct tm *timeinfo=localtime(&timeval); strftime(buf,64,"%Y-%m-%d %T",timeinfo); os<<"\x1B[36m["<<buf<<"]\x1B[0m "; return os; }