use spdlog for logging in the unittest

This commit is contained in:
Benjamin Sergeant 2019-05-13 17:32:57 -07:00
parent 89b9e6e531
commit 66dae5840c
2 changed files with 11 additions and 9 deletions

View File

@ -11,6 +11,7 @@
#include <sstream>
#include <iostream>
#include <mutex>
#include <spdlog/spdlog.h>
namespace ix
{
@ -32,8 +33,9 @@ namespace ix
{
std::lock_guard<std::mutex> lock(_mutex);
std::cerr << obj;
std::cerr << std::endl;
std::stringstream ss;
ss << obj;
spdlog::info(ss.str());
return *this;
}

View File

@ -62,33 +62,33 @@ namespace
std::stringstream ss;
if (messageType == ix::WebSocketMessageType::Open)
{
log("cmd_websocket_satori_chat: connected !");
log("TestConnectionDisconnection: connected !");
}
else if (messageType == ix::WebSocketMessageType::Close)
{
log("cmd_websocket_satori_chat: disconnected !");
log("TestConnectionDisconnection: disconnected !");
}
else if (messageType == ix::WebSocketMessageType::Error)
{
ss << "cmd_websocket_satori_chat: Error! ";
ss << "TestConnectionDisconnection: Error! ";
ss << error.reason;
log(ss.str());
}
else if (messageType == ix::WebSocketMessageType::Message)
{
log("cmd_websocket_satori_chat: received message.!");
log("TestConnectionDisconnection: received message.!");
}
else if (messageType == ix::WebSocketMessageType::Ping)
{
log("cmd_websocket_satori_chat: received ping message.!");
log("TestConnectionDisconnection: received ping message.!");
}
else if (messageType == ix::WebSocketMessageType::Pong)
{
log("cmd_websocket_satori_chat: received pong message.!");
log("TestConnectionDisconnection: received pong message.!");
}
else if (messageType == ix::WebSocketMessageType::Fragment)
{
log("cmd_websocket_satori_chat: received fragment.!");
log("TestConnectionDisconnection: received fragment.!");
}
else
{