Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
0e86c4ee
Commit
0e86c4ee
authored
May 19, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed debug printf
parent
e69aafc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
28 deletions
+7
-28
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+7
-28
No files found.
include/spdlog/details/async_log_helper.h
View file @
0e86c4ee
...
@@ -65,27 +65,8 @@ class async_log_helper
...
@@ -65,27 +65,8 @@ class async_log_helper
{
{
}
}
async_msg
(
async_msg
&&
other
)
SPDLOG_NOEXCEPT
:
logger_name
(
std
::
move
(
other
.
logger_name
)),
async_msg
(
async_msg
&&
other
)
=
default
;
level
(
std
::
move
(
other
.
level
)),
async_msg
&
operator
=
(
async_msg
&&
other
)
=
default
;
time
(
std
::
move
(
other
.
time
)),
thread_id
(
other
.
thread_id
),
txt
(
std
::
move
(
other
.
txt
)),
msg_type
(
std
::
move
(
other
.
msg_type
)),
msg_id
(
other
.
msg_id
)
{
}
async_msg
&
operator
=
(
async_msg
&&
other
)
SPDLOG_NOEXCEPT
{
logger_name
=
std
::
move
(
other
.
logger_name
);
level
=
other
.
level
;
time
=
std
::
move
(
other
.
time
);
thread_id
=
other
.
thread_id
;
txt
=
std
::
move
(
other
.
txt
);
msg_type
=
other
.
msg_type
;
msg_id
=
other
.
msg_id
;
return
*
this
;
}
// never copy or assign. should only be moved..
// never copy or assign. should only be moved..
async_msg
(
const
async_msg
&
)
=
delete
;
async_msg
(
const
async_msg
&
)
=
delete
;
...
@@ -112,6 +93,7 @@ class async_log_helper
...
@@ -112,6 +93,7 @@ class async_log_helper
msg
.
level
=
level
;
msg
.
level
=
level
;
msg
.
time
=
time
;
msg
.
time
=
time
;
msg
.
thread_id
=
thread_id
;
msg
.
thread_id
=
thread_id
;
msg
.
raw
.
clear
();
msg
.
raw
<<
txt
;
msg
.
raw
<<
txt
;
msg
.
msg_id
=
msg_id
;
msg
.
msg_id
=
msg_id
;
}
}
...
@@ -281,7 +263,7 @@ inline void spdlog::details::async_log_helper::worker_loop()
...
@@ -281,7 +263,7 @@ inline void spdlog::details::async_log_helper::worker_loop()
inline
bool
spdlog
::
details
::
async_log_helper
::
process_next_msg
()
inline
bool
spdlog
::
details
::
async_log_helper
::
process_next_msg
()
{
{
async_msg
incoming_async_msg
;
async_msg
incoming_async_msg
;
bool
dequeued
=
_q
.
dequeue_for
(
incoming_async_msg
,
std
::
chrono
::
seconds
(
2
));
bool
dequeued
=
_q
.
dequeue_for
(
incoming_async_msg
,
std
::
chrono
::
seconds
(
2
));
if
(
!
dequeued
)
if
(
!
dequeued
)
{
{
handle_flush_interval
();
handle_flush_interval
();
...
@@ -309,15 +291,13 @@ inline bool spdlog::details::async_log_helper::process_next_msg()
...
@@ -309,15 +291,13 @@ inline bool spdlog::details::async_log_helper::process_next_msg()
s
->
log
(
incoming_log_msg
);
s
->
log
(
incoming_log_msg
);
}
}
}
}
handle_flush_interval
();
handle_flush_interval
();
return
true
;
return
true
;
}
}
assert
(
false
);
assert
(
false
);
return
true
;
// should not be reached
return
true
;
// should not be reached
}
}
inline
void
spdlog
::
details
::
async_log_helper
::
set_formatter
(
formatter_ptr
msg_formatter
)
inline
void
spdlog
::
details
::
async_log_helper
::
set_formatter
(
formatter_ptr
msg_formatter
)
{
{
_formatter
=
std
::
move
(
msg_formatter
);
_formatter
=
std
::
move
(
msg_formatter
);
...
@@ -328,8 +308,7 @@ inline void spdlog::details::async_log_helper::set_error_handler(spdlog::log_err
...
@@ -328,8 +308,7 @@ inline void spdlog::details::async_log_helper::set_error_handler(spdlog::log_err
_err_handler
=
std
::
move
(
err_handler
);
_err_handler
=
std
::
move
(
err_handler
);
}
}
// flush all sinks if _flush_interval_ms has expired.
// flush all sinks if _flush_interval_ms has expired.
inline
void
spdlog
::
details
::
async_log_helper
::
handle_flush_interval
()
inline
void
spdlog
::
details
::
async_log_helper
::
handle_flush_interval
()
{
{
if
(
_flush_interval_ms
==
std
::
chrono
::
milliseconds
::
zero
())
if
(
_flush_interval_ms
==
std
::
chrono
::
milliseconds
::
zero
())
...
@@ -346,7 +325,7 @@ inline void spdlog::details::async_log_helper::handle_flush_interval()
...
@@ -346,7 +325,7 @@ inline void spdlog::details::async_log_helper::handle_flush_interval()
// flush all sinks if _flush_interval_ms has expired. only called if queue is empty
// flush all sinks if _flush_interval_ms has expired. only called if queue is empty
inline
void
spdlog
::
details
::
async_log_helper
::
flush_sinks
()
inline
void
spdlog
::
details
::
async_log_helper
::
flush_sinks
()
{
{
for
(
auto
&
s
:
_sinks
)
for
(
auto
&
s
:
_sinks
)
{
{
s
->
flush
();
s
->
flush
();
...
...
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