From 4bb623a0a3fda0b987c5e9454f20837cfa674c85 Mon Sep 17 00:00:00 2001 From: Vyacheslav Date: Mon, 10 Feb 2020 15:08:51 +0300 Subject: [PATCH] removed unneccessary namespace std --- include/spdlog/tcp_sink.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/spdlog/tcp_sink.h b/include/spdlog/tcp_sink.h index 1c44d644..dff51853 100644 --- a/include/spdlog/tcp_sink.h +++ b/include/spdlog/tcp_sink.h @@ -3,10 +3,11 @@ #include #include +#include #include #include #include -using namespace std; + template class tcp_sink : public spdlog::sinks::base_sink { @@ -15,17 +16,17 @@ public: { if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - SPDLOG_THROW(spdlog_ex("Socket creation error", errno)); + SPDLOG_THROW(spdlog::spdlog_ex("Socket creation error", errno)); } serv_addr.sin_family = AF_INET; serv_addr.sin_port = htons(port); if(inet_pton(AF_INET, address.c_str(), &serv_addr.sin_addr)<=0) { - SPDLOG_THROW(spdlog_ex("Invalid address/ Address not supported", errno)); + SPDLOG_THROW(spdlog::spdlog_ex("Invalid address/ Address not supported", errno)); } if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) { - SPDLOG_THROW(spdlog_ex("Connection Failed", errno)); + SPDLOG_THROW(spdlog::spdlog_ex("Connection Failed", errno)); } } @@ -35,8 +36,8 @@ protected: spdlog::memory_buf_t formatted; spdlog::sinks::base_sink::formatter_->format(msg, formatted); int res = send(sock , formatted.data() , formatted.size() , 0 ); - if(res < 0) - SPDLOG_THROW(spdlog_ex("Message Send Failed", errno)); + if(res < 0) + SPDLOG_THROW(spdlog::spdlog_ex("Message Send Failed", errno)); } void flush_() override