From 35ffa2c1e5c7fba06c52e2c20aff2aac910921d5 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 18 Nov 2018 21:52:35 -0500 Subject: ... --- include/salticidae/network.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include/salticidae/network.h') diff --git a/include/salticidae/network.h b/include/salticidae/network.h index a71c5dd..1e63efa 100644 --- a/include/salticidae/network.h +++ b/include/salticidae/network.h @@ -601,8 +601,19 @@ bool PeerNetwork::check_new_conn(const conn_t &conn, uint16_t port) { p->reset_ping_timer(); p->send_ping(); if (p->connected) - SALTICIDAE_LOG_INFO("PeerNetwork: established connection with %s via %s", - std::string(conn->peer_id).c_str(), std::string(*conn).c_str()); + { + auto color_begin = ""; + auto color_end = ""; + if (logger.is_tty()) + { + color_begin = TTY_COLOR_BLUE; + color_end = TTY_COLOR_RESET; + } + SALTICIDAE_LOG_INFO("%sPeerNetwork: established connection with %s via %s%s", + color_begin, + std::string(conn->peer_id).c_str(), std::string(*conn).c_str(), + color_end); + } return false; } -- cgit v1.2.3