Unverified Commit 4bb623a0 authored by Vyacheslav's avatar Vyacheslav Committed by GitHub

removed unneccessary namespace std

parent 3aa94a09
......@@ -3,10 +3,11 @@
#include <spdlog/spdlog.h>
#include <spdlog/sinks/base_sink.h>
#include <spdlog/common-inl.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
using namespace std;
template<typename Mutex>
class tcp_sink : public spdlog::sinks::base_sink <Mutex>
{
......@@ -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<Mutex>::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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment