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
cd2a484e
Commit
cd2a484e
authored
Jan 15, 2015
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reordered members definition in async_log_helper to prevent gcc warning
parent
08d8be3e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
example/example.cpp
example/example.cpp
+2
-1
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+13
-5
No files found.
example/example.cpp
View file @
cd2a484e
...
@@ -38,7 +38,8 @@ int main(int, char* [])
...
@@ -38,7 +38,8 @@ int main(int, char* [])
// Create console, multithreaded logger
// Create console, multithreaded logger
auto
console
=
spd
::
stdout_logger_mt
(
"console"
);
auto
console
=
spd
::
stdout_logger_mt
(
"console"
);
console
->
info
(
"Welcome to spdlog!"
)
;
const
std
::
string
s
(
"Hello {}"
,
1
);
console
->
info
(
s
)
;
console
->
info
(
"An info message example {}.."
,
1
);
console
->
info
(
"An info message example {}.."
,
1
);
console
->
info
()
<<
"Streams are supported too "
<<
1
;
console
->
info
()
<<
"Streams are supported too "
<<
1
;
...
...
include/spdlog/details/async_log_helper.h
View file @
cd2a484e
...
@@ -109,7 +109,12 @@ public:
...
@@ -109,7 +109,12 @@ public:
using
clock
=
std
::
chrono
::
steady_clock
;
using
clock
=
std
::
chrono
::
steady_clock
;
async_log_helper
(
formatter_ptr
formatter
,
const
std
::
vector
<
sink_ptr
>&
sinks
,
size_t
queue_size
,
const
async_queue_overflow_policy
overflow_policy
=
async_queue_overflow_policy
::
block_retry
,
const
std
::
function
<
void
()
>&
worker_warmup_cb
=
nullptr
);
async_log_helper
(
formatter_ptr
formatter
,
const
std
::
vector
<
sink_ptr
>&
sinks
,
size_t
queue_size
,
const
async_queue_overflow_policy
overflow_policy
=
async_queue_overflow_policy
::
block_retry
,
const
std
::
function
<
void
()
>&
worker_warmup_cb
=
nullptr
);
void
log
(
const
details
::
log_msg
&
msg
);
void
log
(
const
details
::
log_msg
&
msg
);
//Stop logging and join the back thread
//Stop logging and join the back thread
...
@@ -120,8 +125,9 @@ public:
...
@@ -120,8 +125,9 @@ public:
private:
private:
formatter_ptr
_formatter
;
formatter_ptr
_formatter
;
std
::
vector
<
std
::
shared_ptr
<
sinks
::
sink
>>
_sinks
;
std
::
vector
<
std
::
shared_ptr
<
sinks
::
sink
>>
_sinks
;
// queue of messages to log
q_type
_q
;
q_type
_q
;
std
::
thread
_worker_thread
;
// last exception thrown from the worker thread
// last exception thrown from the worker thread
std
::
shared_ptr
<
spdlog_ex
>
_last_workerthread_ex
;
std
::
shared_ptr
<
spdlog_ex
>
_last_workerthread_ex
;
...
@@ -132,6 +138,8 @@ private:
...
@@ -132,6 +138,8 @@ private:
// worker thread warmup callback - one can set thread priority, affinity, etc
// worker thread warmup callback - one can set thread priority, affinity, etc
const
std
::
function
<
void
()
>
_worker_warmup_cb
;
const
std
::
function
<
void
()
>
_worker_warmup_cb
;
// worker thread
std
::
thread
_worker_thread
;
// throw last worker thread exception or if worker thread is not active
// throw last worker thread exception or if worker thread is not active
void
throw_if_bad_worker
();
void
throw_if_bad_worker
();
...
...
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