diff options
Diffstat (limited to 'src/components/transport_manager/src/websocket_server/websocket_session.cc')
-rw-r--r-- | src/components/transport_manager/src/websocket_server/websocket_session.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/components/transport_manager/src/websocket_server/websocket_session.cc b/src/components/transport_manager/src/websocket_server/websocket_session.cc index 8826243777..8a05b9d9aa 100644 --- a/src/components/transport_manager/src/websocket_server/websocket_session.cc +++ b/src/components/transport_manager/src/websocket_server/websocket_session.cc @@ -35,6 +35,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace transport_manager { namespace transport_adapter { +SDL_CREATE_LOG_VARIABLE("WebSocketSession") + using namespace boost::beast::websocket; template <> @@ -80,7 +82,7 @@ WebSocketSession<ExecutorType>::~WebSocketSession() {} template <typename ExecutorType> void WebSocketSession<ExecutorType>::AsyncAccept() { - LOG4CXX_AUTO_TRACE(ws_logger_); + SDL_LOG_AUTO_TRACE(); ws_.async_accept( boost::asio::bind_executor(strand_, std::bind(&WebSocketSession::AsyncRead, @@ -90,10 +92,10 @@ void WebSocketSession<ExecutorType>::AsyncAccept() { template <typename ExecutorType> void WebSocketSession<ExecutorType>::AsyncRead(boost::system::error_code ec) { - LOG4CXX_AUTO_TRACE(ws_logger_); + SDL_LOG_AUTO_TRACE(); if (ec) { auto str_err = "ErrorMessage: " + ec.message(); - LOG4CXX_ERROR(ws_logger_, str_err); + SDL_LOG_ERROR(str_err); return; } @@ -111,7 +113,7 @@ void WebSocketSession<ExecutorType>::WriteDown(Message message) { ws_.write(boost::asio::buffer(message->data(), message->data_size()), ec); if (ec) { - LOG4CXX_ERROR(ws_logger_, "A system error has occurred: " << ec.message()); + SDL_LOG_ERROR("A system error has occurred: " << ec.message()); data_send_failed_(message); on_io_error_(); return; @@ -122,10 +124,10 @@ void WebSocketSession<ExecutorType>::WriteDown(Message message) { template <typename ExecutorType> void WebSocketSession<ExecutorType>::Read(boost::system::error_code ec, std::size_t bytes_transferred) { - LOG4CXX_AUTO_TRACE(ws_logger_); + SDL_LOG_AUTO_TRACE(); boost::ignore_unused(bytes_transferred); if (ec) { - LOG4CXX_ERROR(ws_logger_, ec.message()); + SDL_LOG_ERROR(ec.message()); buffer_.consume(buffer_.size()); on_io_error_(); return; @@ -135,8 +137,7 @@ void WebSocketSession<ExecutorType>::Read(boost::system::error_code ec, const auto data = boost::asio::buffer_cast<const uint8_t*>( boost::beast::buffers_front(buffer_.data())); - LOG4CXX_DEBUG(ws_logger_, - "Msg: " << boost::beast::buffers_to_string(buffer_.data()) + SDL_LOG_DEBUG("Msg: " << boost::beast::buffers_to_string(buffer_.data()) << " Size: " << size;); auto frame = @@ -150,7 +151,7 @@ void WebSocketSession<ExecutorType>::Read(boost::system::error_code ec, template <typename ExecutorType> bool WebSocketSession<ExecutorType>::Shutdown() { - LOG4CXX_AUTO_TRACE(ws_logger_); + SDL_LOG_AUTO_TRACE(); boost::system::error_code ec; if (socket_.is_open()) { socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec); @@ -158,7 +159,7 @@ bool WebSocketSession<ExecutorType>::Shutdown() { } buffer_.consume(buffer_.size()); if (ec) { - LOG4CXX_ERROR(ws_logger_, ec.message()); + SDL_LOG_ERROR(ec.message()); return false; } return true; |