mirror of
https://github.com/gabime/spdlog.git
synced 2026-04-10 11:34:29 +08:00
clang format
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include "spdlog/common.h"
|
||||
#include "spdlog/details/file_helper.h"
|
||||
#include "spdlog/details/os.h"
|
||||
//#include "spdlog/fmt/fmt.h"
|
||||
// #include "spdlog/fmt/fmt.h"
|
||||
|
||||
namespace spdlog {
|
||||
namespace sinks {
|
||||
@@ -113,9 +113,9 @@ 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);
|
||||
throw_spdlog_ex(
|
||||
"rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target),
|
||||
errno);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,8 +125,7 @@ void rotating_file_sink<Mutex>::rotate_() {
|
||||
// delete the target if exists, and rename the src file to target
|
||||
// return true on success, false otherwise.
|
||||
template <typename Mutex>
|
||||
bool rotating_file_sink<Mutex>::rename_file_(const filename_t &src_filename,
|
||||
const filename_t &target_filename) {
|
||||
bool rotating_file_sink<Mutex>::rename_file_(const filename_t &src_filename, const filename_t &target_filename) {
|
||||
// try to delete the target file in case it already exists.
|
||||
(void)details::os::remove(target_filename);
|
||||
return details::os::rename(src_filename, target_filename) == 0;
|
||||
|
||||
Reference in New Issue
Block a user