fix: better logging behaviour

This commit is contained in:
Tobias Reisinger 2020-07-26 21:00:05 +02:00
parent 3e6d0333b7
commit 398019afe8
36 changed files with 256 additions and 188 deletions
src/helpers

View file

@ -20,7 +20,7 @@ helper_connect_tcp_server(char* host, uint16_t port)
hints.ai_socktype = SOCK_STREAM; //set socket flag
if ((status = getaddrinfo(host, port_str, &hints, &res)) != 0) { //getaddrinfo() will evaluate the given address, using the hints-flags and port, and return an IP address and other server infos
LOG_ERROR("getaddrinfo: %s\n", gai_strerror(status));
LOGGER_ERR("getaddrinfo: %s\n", gai_strerror(status));
return -1;
}
@ -28,7 +28,7 @@ helper_connect_tcp_server(char* host, uint16_t port)
s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); //creating Socket
if ((status = connect(s, res->ai_addr, res->ai_addrlen)) != 0) {
LOG_ERROR("connect() failed\n");
LOGGER_ERR("connect() failed\n");
freeaddrinfo(res);
return -1;
}