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
295e189b
Commit
295e189b
authored
Jan 14, 2015
by
Denis Ivaykin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle
parent
365d8954
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+4
-4
include/spdlog/details/registry.h
include/spdlog/details/registry.h
+4
-4
include/spdlog/spdlog.h
include/spdlog/spdlog.h
+4
-3
No files found.
include/spdlog/details/async_log_helper.h
View file @
295e189b
...
@@ -125,9 +125,9 @@ private:
...
@@ -125,9 +125,9 @@ private:
// 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
;
// overflow policy
// overflow policy
const
async_queue_overflow_policy
_overflow_policy
;
const
async_queue_overflow_policy
_overflow_policy
;
// 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
;
...
@@ -157,7 +157,7 @@ inline spdlog::details::async_log_helper::async_log_helper(formatter_ptr formatt
...
@@ -157,7 +157,7 @@ inline spdlog::details::async_log_helper::async_log_helper(formatter_ptr formatt
_formatter
(
formatter
),
_formatter
(
formatter
),
_sinks
(
sinks
),
_sinks
(
sinks
),
_q
(
queue_size
),
_q
(
queue_size
),
_overflow_policy
(
overflow_policy
),
_overflow_policy
(
overflow_policy
),
_worker_warmup_cb
(
worker_warmup_cb
),
_worker_warmup_cb
(
worker_warmup_cb
),
_worker_thread
(
&
async_log_helper
::
worker_loop
,
this
)
_worker_thread
(
&
async_log_helper
::
worker_loop
,
this
)
{}
{}
...
...
include/spdlog/details/registry.h
View file @
295e189b
...
@@ -125,8 +125,8 @@ public:
...
@@ -125,8 +125,8 @@ public:
std
::
lock_guard
<
std
::
mutex
>
lock
(
_mutex
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
_mutex
);
_async_mode
=
true
;
_async_mode
=
true
;
_async_q_size
=
q_size
;
_async_q_size
=
q_size
;
_overflow_policy
=
overflow_policy
;
_overflow_policy
=
overflow_policy
;
_worker_warmup_cb
=
worker_warmup_cb
;
_worker_warmup_cb
=
worker_warmup_cb
;
}
}
void
set_sync_mode
()
void
set_sync_mode
()
...
@@ -152,8 +152,8 @@ private:
...
@@ -152,8 +152,8 @@ private:
level
::
level_enum
_level
=
level
::
info
;
level
::
level_enum
_level
=
level
::
info
;
bool
_async_mode
=
false
;
bool
_async_mode
=
false
;
size_t
_async_q_size
=
0
;
size_t
_async_q_size
=
0
;
async_queue_overflow_policy
_overflow_policy
=
async_queue_overflow_policy
::
block_retry
;
async_queue_overflow_policy
_overflow_policy
=
async_queue_overflow_policy
::
block_retry
;
std
::
function
<
void
()
>
_worker_warmup_cb
=
nullptr
;
std
::
function
<
void
()
>
_worker_warmup_cb
=
nullptr
;
};
};
}
}
}
}
include/spdlog/spdlog.h
View file @
295e189b
...
@@ -61,9 +61,10 @@ void set_level(level::level_enum log_level);
...
@@ -61,9 +61,10 @@ void set_level(level::level_enum log_level);
// Async mode - off by default.
// Async mode - off by default.
//
//
enum
class
async_queue_overflow_policy
{
enum
class
async_queue_overflow_policy
block_retry
,
// Block / yield / sleep until message can be enqueued
{
discard_log_msg
// Discard the message it enqueue fails
block_retry
,
// Block / yield / sleep until message can be enqueued
discard_log_msg
// Discard the message it enqueue fails
};
};
// Turn on async mode and set the queue size for each async_logger
// Turn on async mode and set the queue size for each async_logger
...
...
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