Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
37459ae9
Commit
37459ae9
authored
Nov 12, 2014
by
Arnaud Kapp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check return code from std::remove.
In case removing a file (file_sink) fails, we throw spdlog_ex.
parent
1008f569
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
file_sinks.h
include/spdlog/sinks/file_sinks.h
+10
-2
No files found.
include/spdlog/sinks/file_sinks.h
View file @
37459ae9
...
...
@@ -125,14 +125,22 @@ private:
std
::
string
target
=
calc_filename
(
_base_filename
,
i
,
_extension
);
if
(
details
::
file_helper
::
file_exists
(
target
))
std
::
remove
(
target
.
c_str
());
{
if
(
std
::
remove
(
target
.
c_str
())
!=
0
)
{
throw
spdlog_ex
(
"rotating_file_sink: failed removing "
+
target
);
}
}
if
(
details
::
file_helper
::
file_exists
(
src
)
&&
std
::
rename
(
src
.
c_str
(),
target
.
c_str
()))
{
throw
spdlog_ex
(
"rotating_file_sink: failed renaming "
+
src
+
" to "
+
target
);
}
}
auto
cur_name
=
_file_helper
.
filename
();
std
::
remove
(
cur_name
.
c_str
());
if
(
std
::
remove
(
cur_name
.
c_str
())
!=
0
)
{
throw
spdlog_ex
(
"rotating_file_sink: failed removing "
+
cur_name
);
}
_file_helper
.
open
(
cur_name
);
}
std
::
string
_base_filename
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment