diff --git a/src/WebSocketServer.cpp b/src/WebSocketServer.cpp index 0293e920..5c3d71e1 100644 --- a/src/WebSocketServer.cpp +++ b/src/WebSocketServer.cpp @@ -79,12 +79,13 @@ void WebSocketServer::Start() } _serverPort = conf->ServerPort; + _debugEnabled = conf->DebugEnabled; _authenticationRequired = conf->AuthRequired; _authenticationSalt = Utils::Crypto::GenerateSalt(); _authenticationSecret = Utils::Crypto::GenerateSecret(conf->ServerPassword.toStdString(), _authenticationSalt); // Set log levels if debug is enabled - if (conf->DebugEnabled) { + if (_debugEnabled) { _server.get_alog().set_channels(websocketpp::log::alevel::all); _server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control); _server.get_elog().set_channels(websocketpp::log::elevel::all); diff --git a/src/WebSocketServer.h b/src/WebSocketServer.h index bc4b2bf4..f72300df 100644 --- a/src/WebSocketServer.h +++ b/src/WebSocketServer.h @@ -89,6 +89,7 @@ class WebSocketServer : QObject std::mutex _sessionMutex; std::map> _sessions; uint16_t _serverPort; + bool _debugEnabled; bool _authenticationRequired; std::string _authenticationSecret; std::string _authenticationSalt;