mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Fixed issue #720
This commit is contained in:
parent
15f3b0fea5
commit
378c7789ba
@ -158,18 +158,9 @@ public:
|
||||
|
||||
spdlog_ex(const std::string &msg, int last_errno)
|
||||
{
|
||||
std::string errno_string;
|
||||
char buf[500], *buf_ptr = buf;
|
||||
|
||||
if (fmt::safe_strerror(last_errno, buf_ptr, sizeof(buf)) == 0)
|
||||
{
|
||||
errno_string = buf_ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
errno_string = "Unknown error";
|
||||
}
|
||||
_msg = msg + ": " + errno_string;
|
||||
fmt::MemoryWriter writer;
|
||||
fmt::format_system_error(writer, last_errno, msg);
|
||||
_msg = writer.str();
|
||||
}
|
||||
|
||||
const char *what() const SPDLOG_NOEXCEPT override
|
||||
|
Loading…
Reference in New Issue
Block a user