log on error
This commit is contained in:
parent
0e204bf2c1
commit
97469e3e43
@ -1,5 +1,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#include "API.h"
|
#include "API.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
@ -9,7 +10,6 @@ int main() {
|
|||||||
|
|
||||||
|
|
||||||
std::string ip = api.request("https://api.ipify.org");
|
std::string ip = api.request("https://api.ipify.org");
|
||||||
std::cout << "ip is: " << ip <<std::endl;
|
|
||||||
|
|
||||||
std::string oldip = logger.readip();
|
std::string oldip = logger.readip();
|
||||||
|
|
||||||
@ -36,6 +36,10 @@ int main() {
|
|||||||
|
|
||||||
std::cout << "---" << dynurepl << std::endl;
|
std::cout << "---" << dynurepl << std::endl;
|
||||||
|
|
||||||
|
if (dynurepl != "{\"statusCode\":200}"){
|
||||||
|
logger.logToLogfile(" [ERROR] failed to write ip to dynu api!");
|
||||||
|
}
|
||||||
|
|
||||||
logger.safeip(ip);
|
logger.safeip(ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user