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
67a6eaf2
Commit
67a6eaf2
authored
May 23, 2018
by
gabime
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/gabime/spdlog
parents
f4db1c51
2aa25109
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
step_file_sink.h
include/spdlog/contrib/sinks/step_file_sink.h
+15
-2
async_log_helper.h
include/spdlog/details/async_log_helper.h
+0
-1
No files found.
include/spdlog/contrib/sinks/step_file_sink.h
View file @
67a6eaf2
...
@@ -57,10 +57,23 @@ struct default_step_file_name_calculator
...
@@ -57,10 +57,23 @@ struct default_step_file_name_calculator
}
}
};
};
/*
* The default action when recording starts
*/
struct
default_action_when_recording_starts
{
// Write the start message to the beginning of the file and return its size
static
size_t
beginning_of_file
()
{
return
0
;
}
};
/*
/*
* Rotating file sink based on size and a specified time step
* Rotating file sink based on size and a specified time step
*/
*/
template
<
class
Mutex
,
class
FileNameCalc
=
default_step_file_name_calculator
>
template
<
class
Mutex
,
class
FileNameCalc
=
default_step_file_name_calculator
,
class
RecordingStartActions
=
default_action_when_recording_starts
>
class
step_file_sink
SPDLOG_FINAL
:
public
base_sink
<
Mutex
>
class
step_file_sink
SPDLOG_FINAL
:
public
base_sink
<
Mutex
>
{
{
public
:
public
:
...
@@ -113,7 +126,7 @@ protected:
...
@@ -113,7 +126,7 @@ protected:
std
::
tie
(
_current_filename
,
std
::
ignore
)
=
FileNameCalc
::
calc_filename
(
_base_filename
,
_tmp_ext
);
std
::
tie
(
_current_filename
,
std
::
ignore
)
=
FileNameCalc
::
calc_filename
(
_base_filename
,
_tmp_ext
);
_file_helper
.
open
(
_current_filename
);
_file_helper
.
open
(
_current_filename
);
_tp
=
_next_tp
();
_tp
=
_next_tp
();
_current_size
=
msg
.
formatted
.
size
();
_current_size
=
msg
.
formatted
.
size
()
+
RecordingStartActions
::
beginning_of_file
()
;
}
}
_file_helper
.
write
(
msg
);
_file_helper
.
write
(
msg
);
}
}
...
...
include/spdlog/details/async_log_helper.h
View file @
67a6eaf2
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include <condition_variable>
#include <condition_variable>
#include <exception>
#include <exception>
#include <functional>
#include <functional>
#include <iostream>
#include <memory>
#include <memory>
#include <string>
#include <string>
#include <thread>
#include <thread>
...
...
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