Added configuration and logging for lightcontrol
[wakeup.git] / src / logging.cpp
diff --git a/src/logging.cpp b/src/logging.cpp
new file mode 100644 (file)
index 0000000..65241dc
--- /dev/null
@@ -0,0 +1,26 @@
+#include <date.h>
+
+#include "logging.h"
+
+
+logstream & logstream::operator << (const char *msg)
+{
+   UTC timestamp;
+
+   timestamp = Now();
+
+   destination << timestamp << ": " << msg << "\n";
+
+   return *this;
+}
+
+logstream & logstream::operator << (const String &msg)
+{
+   UTC timestamp;
+
+   timestamp = Now();
+
+   destination << timestamp << ": " << msg << "\n";
+
+   return *this;
+}