Update rotating_file_sink-inl.h

This commit is contained in:
Gabi Melman 2020-02-12 07:51:42 +02:00 committed by GitHub
parent 64dd4dc219
commit 53a56b82af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_()
} }
filename_t target = calc_filename(base_filename_, i); filename_t target = calc_filename(base_filename_, i);
if (!rename_file(src, target)) if (!rename_file_(src, target))
{ {
// if failed try again after a small delay. // if failed try again after a small delay.
// this is a workaround to a windows issue, where very high rotation // this is a workaround to a windows issue, where very high rotation
@ -121,7 +121,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_()
// delete the target if exists, and rename the src file to target // delete the target if exists, and rename the src file to target
// return true on success, false otherwise. // return true on success, false otherwise.
template<typename Mutex> template<typename Mutex>
SPDLOG_INLINE bool rotating_file_sink<Mutex>::rename_file_(const filename_t &src_filename, const filename_t &target_filename) SPDLOG_INLINE bool rotating_file_sink<Mutex>::rename_file_(yconst filename_t &src_filename, const filename_t &target_filename)
{ {
// try to delete the target file in case it already exists. // try to delete the target file in case it already exists.
(void)details::os::remove(target_filename); (void)details::os::remove(target_filename);