From 6c96998ace5468dcd58cd0cc64a1b289bb19da59 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 14 Feb 2017 23:18:51 -0800 Subject: [PATCH] Let's disable web socket logging by default (unless enabled in prefs) --- src/contrib/websocket_remote/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/contrib/websocket_remote/main.cpp b/src/contrib/websocket_remote/main.cpp index 82bd214ab..fb2252519 100644 --- a/src/contrib/websocket_remote/main.cpp +++ b/src/contrib/websocket_remote/main.cpp @@ -807,10 +807,16 @@ class PlaybackRemote : public IPlaybackRemote { void ThreadProc() { try { - wss.get_alog().set_ostream(&std::cerr); - wss.get_elog().set_ostream(&std::cerr); - wss.set_access_channels(websocketpp::log::alevel::all); - wss.clear_access_channels(websocketpp::log::alevel::frame_payload); + if (preferences->GetBool("debug")) { + wss.get_alog().set_ostream(&std::cerr); + wss.get_elog().set_ostream(&std::cerr); + wss.set_access_channels(websocketpp::log::alevel::all); + wss.clear_access_channels(websocketpp::log::alevel::frame_payload); + } + else { + wss.set_access_channels(websocketpp::log::alevel::none); + wss.clear_access_channels(websocketpp::log::alevel::none); + } wss.init_asio(); wss.set_message_handler(std::bind(&PlaybackRemote::OnMessage, this, &wss, ::_1, ::_2));