mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
split log_fail_result from log_close_result
This commit is contained in:
@@ -1040,11 +1040,16 @@ private:
|
||||
|
||||
/// Prints information about a connection being closed to the access log
|
||||
/**
|
||||
* Prints information about a connection being closed to the access log.
|
||||
* Includes: local and remote close codes and reasons
|
||||
*/
|
||||
void log_close_result();
|
||||
|
||||
/// Prints information about a connection being failed to the access log
|
||||
/**
|
||||
* Includes: error code and message for why it was failed
|
||||
*/
|
||||
void log_fail_result();
|
||||
|
||||
// static settings
|
||||
const std::string m_user_agent;
|
||||
|
||||
|
||||
@@ -1409,8 +1409,7 @@ void connection<config>::handle_terminate(terminate_status tstat,
|
||||
if (m_fail_handler) {
|
||||
m_fail_handler(m_connection_hdl);
|
||||
}
|
||||
// TODO: custom fail output log format?
|
||||
log_close_result();
|
||||
log_fail_result();
|
||||
} else if (tstat == closed) {
|
||||
if (m_close_handler) {
|
||||
m_close_handler(m_connection_hdl);
|
||||
@@ -1912,6 +1911,14 @@ void connection<config>::log_close_result()
|
||||
m_alog.write(log::alevel::disconnect,s.str());
|
||||
}
|
||||
|
||||
template <typename config>
|
||||
void connection<config>::log_fail_result()
|
||||
{
|
||||
// TODO: include more information about the connection?
|
||||
// should this be filed under connect rather than disconnect?
|
||||
m_alog.write(log::alevel::disconnect,"Failed: "+m_ec.message());
|
||||
}
|
||||
|
||||
} // namespace websocketpp
|
||||
|
||||
#endif // WEBSOCKETPP_CONNECTION_IMPL_HPP
|
||||
|
||||
Reference in New Issue
Block a user