mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
Move Log to ripple_basics and split websocket logging to ripple_net
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "ripple_net.h"
|
||||
|
||||
#include "../websocketpp/src/logger/logger.hpp" // for ripple_LogWebSockets.cpp
|
||||
|
||||
// VFALCO: TODO, fix these warnings!
|
||||
#ifdef _MSC_VER
|
||||
//#pragma warning (push) // Causes spurious C4503 "decorated name exceeds maximum length"
|
||||
@@ -53,6 +55,8 @@ static DH* handleTmpDh(SSL* ssl, int is_export, int iKeyLength)
|
||||
#include "src/cpp/ripple/PeerDoor.cpp"
|
||||
#include "src/cpp/ripple/WSDoor.cpp" // uses logging in WSConnection.h
|
||||
|
||||
#include "sockets/ripple_LogWebsockets.cpp"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
//#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
36
modules/ripple_net/sockets/ripple_LogWebsockets.cpp
Normal file
36
modules/ripple_net/sockets/ripple_LogWebsockets.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace websocketpp
|
||||
{
|
||||
namespace log
|
||||
{
|
||||
LogPartition websocketPartition("WebSocket");
|
||||
|
||||
void websocketLog(websocketpp::log::alevel::value v, const std::string& entry)
|
||||
{
|
||||
if ((v == websocketpp::log::alevel::DEVEL) || (v == websocketpp::log::alevel::DEBUG_CLOSE))
|
||||
{
|
||||
if (websocketPartition.doLog(lsTRACE))
|
||||
Log(lsDEBUG, websocketPartition) << entry;
|
||||
}
|
||||
else if (websocketPartition.doLog(lsDEBUG))
|
||||
Log(lsDEBUG, websocketPartition) << entry;
|
||||
}
|
||||
|
||||
void websocketLog(websocketpp::log::elevel::value v, const std::string& entry)
|
||||
{
|
||||
LogSeverity s = lsDEBUG;
|
||||
if ((v & websocketpp::log::elevel::INFO) != 0)
|
||||
s = lsINFO;
|
||||
else if ((v & websocketpp::log::elevel::FATAL) != 0)
|
||||
s = lsFATAL;
|
||||
else if ((v & websocketpp::log::elevel::RERROR) != 0)
|
||||
s = lsERROR;
|
||||
else if ((v & websocketpp::log::elevel::WARN) != 0)
|
||||
s = lsWARNING;
|
||||
if (websocketPartition.doLog(s))
|
||||
Log(s, websocketPartition) << entry;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user