aboutsummaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'util.cpp')
-rw-r--r--util.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/util.cpp b/util.cpp
new file mode 100644
index 0000000..b85f89e
--- /dev/null
+++ b/util.cpp
@@ -0,0 +1,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;
+}