Back to C++20 standard!

Logging is worked (AdcOstreamLogger and AdcSPDLOGLogger classes)
This commit is contained in:
2024-11-14 18:33:07 +03:00
parent 05e0055193
commit 78a9e53d18
9 changed files with 334 additions and 196 deletions

View File

@@ -296,6 +296,15 @@ public:
_acceptor.close(ec);
}
std::string localEndpoint() const
{
std::stringstream st;
st << _acceptor.local_endpoint();
return st.str();
}
private:
asio::io_context& _ioContext;
srv_acceptor_t _acceptor;
@@ -758,11 +767,17 @@ public:
}
// static void formatError(std::error_code err, std::string& result_str)
// {
// std::format_to(std::back_inserter(result_str), "{} (Err category: {}) (Err msg: {})", err.value(),
// err.category().name(), err.message());
// }
std::string remoteEndpoint() const
{
std::stringstream st;
st << _socket.remote_endpoint();
if (st.str().empty()) {
return "<local>";
}
return st.str();
}
static std::string formattableError(std::error_code ec)
{