mirror of
https://github.com/gabime/spdlog.git
synced 2025-11-16 09:28:56 +08:00
Moved throw to dedicated function throw_spdlog_ex
This commit is contained in:
@@ -64,7 +64,7 @@ protected:
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
SPDLOG_THROW(spdlog_ex("__android_log_write() failed", ret));
|
||||
throw_spdlog_ex("__android_log_write() failed", ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
{
|
||||
if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || rotation_minute > 59)
|
||||
{
|
||||
SPDLOG_THROW(spdlog_ex("daily_file_sink: Invalid rotation time in ctor"));
|
||||
throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor");
|
||||
}
|
||||
|
||||
auto now = log_clock::now();
|
||||
@@ -164,7 +164,7 @@ private:
|
||||
if (!ok)
|
||||
{
|
||||
filenames_q_.push_back(std::move(current_file));
|
||||
SPDLOG_THROW(spdlog_ex("Failed removing daily file " + filename_to_str(old_filename), errno));
|
||||
throw_spdlog_ex("Failed removing daily file " + filename_to_str(old_filename), errno);
|
||||
}
|
||||
}
|
||||
filenames_q_.push_back(std::move(current_file));
|
||||
|
||||
@@ -72,7 +72,7 @@ protected:
|
||||
|
||||
if (err)
|
||||
{
|
||||
SPDLOG_THROW(spdlog_ex("Failed writing to systemd", errno));
|
||||
throw_spdlog_ex("Failed writing to systemd", errno);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
{
|
||||
if (!::IsValidSid(psid))
|
||||
{
|
||||
SPDLOG_THROW(spdlog_ex("sid_t::sid_t(): invalid SID received"));
|
||||
throw_spdlog_ex("sid_t::sid_t(): invalid SID received");
|
||||
}
|
||||
|
||||
auto const sid_length{::GetLengthSid(psid)};
|
||||
|
||||
@@ -158,7 +158,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const memory_buf_
|
||||
bool ok = ::WriteFile(out_handle_, formatted.data() + total_written, size - total_written, &bytes_written, nullptr) != 0;
|
||||
if (!ok || bytes_written == 0)
|
||||
{
|
||||
SPDLOG_THROW(spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError())));
|
||||
throw_spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()));
|
||||
}
|
||||
total_written += bytes_written;
|
||||
} while (total_written < size);
|
||||
|
||||
Reference in New Issue
Block a user