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
3a1ac8b4
Commit
3a1ac8b4
authored
Mar 29, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
async_sink fixes
parent
7cbf6dcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
example.cpp
example/example.cpp
+2
-2
async_sink.h
include/c11log/sinks/async_sink.h
+2
-2
No files found.
example/example.cpp
View file @
3a1ac8b4
...
...
@@ -25,7 +25,7 @@ int main(int argc, char* argv[])
//auto fsink = std::make_shared<sinks::rotating_file_sink>("log", "txt", 1024*1024*50 , 5, 0);
auto
as
=
std
::
make_shared
<
sinks
::
async_sink
>
(
howmany
);
auto
as
=
std
::
make_shared
<
sinks
::
async_sink
>
(
1000
);
as
->
add_sink
(
sinks
::
null_sink
::
get
());
logger
my_logger
(
"my_logger"
,
as
);
...
...
@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
for
(
unsigned
int
i
=
0
;
i
<
howmany
;
i
++
)
my_logger
.
info
()
<<
"Hello logger"
;
as
->
shutdown
(
milliseconds
(
5000
));
auto
delta
=
system_clock
::
now
()
-
start
;
auto
delta_d
=
duration_cast
<
duration
<
double
>>
(
delta
).
count
();
...
...
include/c11log/sinks/async_sink.h
View file @
3a1ac8b4
...
...
@@ -68,8 +68,8 @@ inline c11log::sinks::async_sink::~async_sink()
}
inline
void
c11log
::
sinks
::
async_sink
::
_sink_it
(
const
details
::
log_msg
&
msg
)
{
auto
msg_size
=
msg
.
msg_buf
.
second
;
if
(
!
msg_size
)
auto
msg_size
=
msg
.
msg_buf
.
second
;
if
(
!
_active
||
!
msg_size
)
return
;
//re allocate on the heap the (stack based) message
auto
new_msg
=
new
details
::
log_msg
();
...
...
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