diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/standalone.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/standalone.cpp b/src/standalone.cpp index 19b2f51..d47448d 100644 --- a/src/standalone.cpp +++ b/src/standalone.cpp @@ -107,6 +107,7 @@ #include <thread> #include <sstream> #include <vector> +#include <ctime> #include "../include/Gobbledegook.h" @@ -214,7 +215,11 @@ int dataSetter(const char *pName, const void *pData) LogDebug((std::string("Server data: setting ")+strName).c_str()); // the server can only receive a temperature reading, let's print it const char* strData = static_cast<const char *>(pData); - std::cout << strData << std::endl; + std::time_t now = std::time(0); + char str_now[100]; + std::strftime(str_now,sizeof(str_now),"%Y-%m-%d %H:%M:%S",std::gmtime(&now)); + + std::cout << str_now << " " << strData << std::endl; return 1; } |