aboutsummaryrefslogtreecommitdiff
path: root/util.cpp
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-05-11 21:24:57 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-05-11 21:24:57 +0200
commitce356164bac0f739fea97b8bee61c066b9f2ae87 (patch)
treebf73239c76e0288de9378f06c322766889ef1fb9 /util.cpp
parentbfd76241386fe54c4394171c861f4b1676b5bf32 (diff)
Add <<debug<< log, clean up some code and let find return a list instead of 1 element
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;
+}