wip - no-exceptions support

This commit is contained in:
gabime
2019-08-18 19:46:28 +03:00
parent db1babab5e
commit b0a25f0183
55 changed files with 56523 additions and 18 deletions

View File

@@ -64,7 +64,7 @@ protected:
if (ret < 0)
{
throw spdlog_ex("__android_log_write() failed", ret);
SPDLOG_THROW spdlog_ex("__android_log_write() failed", ret);
}
}

View File

@@ -52,7 +52,7 @@ public:
{
if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || rotation_minute > 59)
{
throw spdlog_ex("daily_file_sink: Invalid rotation time in ctor");
SPDLOG_THROW spdlog_ex("daily_file_sink: Invalid rotation time in ctor");
}
auto now = log_clock::now();
file_helper_.open(FileNameCalc::calc_filename(base_filename_, now_tm(now)), truncate_);

View File

@@ -112,7 +112,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_()
{
file_helper_.reopen(true); // truncate the log file anyway to prevent it to grow beyond its limit!
current_size_ = 0;
throw spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno);
SPDLOG_THROW spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno);
}
}
}

View File

@@ -66,7 +66,7 @@ protected:
if (err)
{
throw spdlog_ex("Failed writing to systemd", errno);
SPDLOG_THROW spdlog_ex("Failed writing to systemd", errno);
}
}

View File

@@ -153,7 +153,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::write_to_file_(const fmt::memory
bool ok = ::WriteFile(out_handle_, formatted.data() + total_written, size - total_written, &bytes_written, nullptr) != 0;
if (!ok || bytes_written == 0)
{
throw spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()));
SPDLOG_THROW spdlog_ex("wincolor_sink: write_to_file_ failed. GetLastError(): " + std::to_string(::GetLastError()));
}
total_written += bytes_written;
} while (total_written < size);