Skip to content

Commit 15b502f

Browse files
author
Steve Axthelm
authored
Merge pull request #259 from nicklewis/PE-33165-disable-websocket-logging
(PE-33165) Disable websocket logging
2 parents aa07d4c + 9be6caa commit 15b502f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/inc/cpp-pcp-client/connector/connection.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ namespace websocketpp {
2929
template <typename T>
3030
class client;
3131

32+
namespace config {
33+
struct asio_tls_client;
34+
}
35+
3236
namespace message_buffer {
3337
namespace alloc {
3438
template <typename message>
@@ -58,7 +62,9 @@ static const std::string DEFAULT_CLOSE_REASON { "Closed by client" };
5862

5963
// Configuration of the WebSocket transport layer
6064

61-
using WS_Client_Type = websocketpp::client<ws_config>;
65+
// Use the default client type, without devel logging enabled, until PE-33165
66+
// is fixed.
67+
using WS_Client_Type = websocketpp::client<websocketpp::config::asio_tls_client>;
6268
using WS_Context_Ptr = websocketpp::lib::shared_ptr<boost::asio::ssl::context>;
6369
using WS_Connection_Handle = websocketpp::connection_hdl;
6470

lib/src/connector/connection.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ Connection::Connection(std::vector<std::string> broker_ws_uris,
8585
consecutive_pong_timeouts_ { 0 },
8686
endpoint_ { new WS_Client_Type() }
8787
{
88+
// Disable websocket logging until PE-33165 is resolved.
89+
setWebSocketLogLevel(leatherman::logging::log_level::none);
90+
setWebSocketLogStream(nullptr);
91+
8892
// Initialize the transport system. Note that in perpetual mode,
8993
// the event loop does not terminate when there are no connections
90-
setWebSocketLogLevel(client_metadata_.loglevel);
91-
setWebSocketLogStream(client_metadata_.logstream);
9294
endpoint_->init_asio();
9395
endpoint_->start_perpetual();
9496

0 commit comments

Comments
 (0)