Print error and abort instead of throw if SPDLOG_NO_EXEPTIONS is defined

This commit is contained in:
gabime
2019-08-19 11:31:33 +03:00
parent b0a25f0183
commit 0335e3fcc0
17 changed files with 88 additions and 74 deletions

View File

@@ -52,7 +52,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");
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,8 @@ 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;
SPDLOG_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)
{
SPDLOG_THROW spdlog_ex("Failed writing to systemd", errno);
SPDLOG_THROW(spdlog_ex("Failed writing to systemd", errno));
}
}