mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
adds timestamps to error/access logs and boost date_time dependency
This commit is contained in:
@@ -5,9 +5,9 @@ CXX ?= c++
|
||||
SHARED ?= "1"
|
||||
|
||||
ifeq ($(SHARED), 1)
|
||||
LDFLAGS := $(LDFLAGS) -lboost_system -lwebsocketpp
|
||||
LDFLAGS := $(LDFLAGS) -lboost_system -lboost_date_time -lwebsocketpp
|
||||
else
|
||||
LDFLAGS := $(LDFLAGS) -lboost_system ../../libwebsocketpp.a
|
||||
LDFLAGS := $(LDFLAGS) -lboost_system -lboost_date_time ../../libwebsocketpp.a
|
||||
endif
|
||||
|
||||
echo_server: echo_server.o echo.o
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "websocket_server.hpp"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -80,10 +81,16 @@ bool server::validate_message_size(uint64_t val) {
|
||||
}
|
||||
|
||||
void server::error_log(std::string msg) {
|
||||
std::cerr << "[Error Log] " << msg << std::endl;
|
||||
std::cerr << "[Error Log] "
|
||||
<< boost::posix_time::to_iso_extended_string(
|
||||
boost::posix_time::second_clock::local_time())
|
||||
<< " " << msg << std::endl;
|
||||
}
|
||||
void server::access_log(std::string msg) {
|
||||
std::cout << "[Access Log] " << msg << std::endl;
|
||||
std::cout << "[Access Log] "
|
||||
<< boost::posix_time::to_iso_extended_string(
|
||||
boost::posix_time::second_clock::local_time())
|
||||
<< " " << msg << std::endl;
|
||||
}
|
||||
|
||||
void server::start_accept() {
|
||||
@@ -116,4 +123,4 @@ void server::handle_accept(session_ptr session,
|
||||
}
|
||||
|
||||
this->start_accept();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user