log on error

This commit is contained in:
max mustermann 2019-05-05 16:42:39 +02:00
parent 0e204bf2c1
commit 97469e3e43

View File

@ -1,5 +1,6 @@
#include <iostream>
#include <ctime>
#include "API.h"
#include "Logger.h"
@ -9,7 +10,6 @@ int main() {
std::string ip = api.request("https://api.ipify.org");
std::cout << "ip is: " << ip <<std::endl;
std::string oldip = logger.readip();
@ -36,6 +36,10 @@ int main() {
std::cout << "---" << dynurepl << std::endl;
if (dynurepl != "{\"statusCode\":200}"){
logger.logToLogfile(" [ERROR] failed to write ip to dynu api!");
}
logger.safeip(ip);
}