removed unneccessary namespace std
This commit is contained in:
		@@ -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));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
@@ -36,7 +37,7 @@ protected:
 | 
			
		||||
        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));
 | 
			
		||||
            SPDLOG_THROW(spdlog::spdlog_ex("Message Send Failed", errno));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void flush_() override
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user