Filter out annoying log statements in unit tests.

These may be useful when debugging toxcore locally, but are not useful in
unit tests.
This commit is contained in:
iphydf 2018-01-14 01:49:09 +00:00
parent e775b5533b
commit c38d3de604
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 6 additions and 1 deletions

View File

@ -51,6 +51,11 @@ static void print_debug_log(Tox *m, TOX_LOG_LEVEL level, const char *path, uint3
return;
}
if (strncmp(message, "Bound successfully to ", strlen("Bound successfully to ")) ||
strncmp(message, "Found node in LAN: ", strlen("Found node in LAN: "))) {
return;
}
uint32_t index = user_data ? *(uint32_t *)user_data : 0;
const char *file = strrchr(path, '/');
file = file ? file + 1 : path;

View File

@ -356,7 +356,7 @@ static int handle_LANdiscovery(void *object, IP_Port source, const uint8_t *pack
char ip_str[IP_NTOA_LEN] = { 0 };
ip_ntoa(&source.ip, ip_str, sizeof(ip_str));
LOGGER_INFO(dht->log, "Found node in LAN: %s", ip_str);
LOGGER_DEBUG(dht->log, "Found node in LAN: %s", ip_str);
DHT_bootstrap(dht, source, packet + 1);
return 0;