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
c465250c
Commit
c465250c
authored
Oct 16, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed clang-tidy warning (added move)
parent
815b52b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
async.h
include/spdlog/async.h
+6
-6
async_logger_impl.h
include/spdlog/details/async_logger_impl.h
+3
-3
No files found.
include/spdlog/async.h
View file @
c465250c
...
...
@@ -37,7 +37,7 @@ template<async_overflow_policy OverflowPolicy = async_overflow_policy::block>
struct
async_factory_impl
{
template
<
typename
Sink
,
typename
...
SinkArgs
>
static
std
::
shared_ptr
<
async_logger
>
create
(
const
std
::
string
&
logger_name
,
SinkArgs
&&
...
args
)
static
std
::
shared_ptr
<
async_logger
>
create
(
std
::
string
logger_name
,
SinkArgs
&&
...
args
)
{
auto
&
registry_inst
=
details
::
registry
::
instance
();
...
...
@@ -51,7 +51,7 @@ struct async_factory_impl
}
auto
sink
=
std
::
make_shared
<
Sink
>
(
std
::
forward
<
SinkArgs
>
(
args
)...);
auto
new_logger
=
std
::
make_shared
<
async_logger
>
(
logger_name
,
std
::
move
(
sink
),
std
::
move
(
tp
),
OverflowPolicy
);
auto
new_logger
=
std
::
make_shared
<
async_logger
>
(
std
::
move
(
logger_name
)
,
std
::
move
(
sink
),
std
::
move
(
tp
),
OverflowPolicy
);
registry_inst
.
register_and_init
(
new_logger
);
return
new_logger
;
}
...
...
@@ -61,15 +61,15 @@ using async_factory = async_factory_impl<async_overflow_policy::block>;
using
async_factory_nonblock
=
async_factory_impl
<
async_overflow_policy
::
overrun_oldest
>
;
template
<
typename
Sink
,
typename
...
SinkArgs
>
inline
std
::
shared_ptr
<
spdlog
::
logger
>
create_async
(
const
std
::
string
&
logger_name
,
SinkArgs
&&
...
sink_args
)
inline
std
::
shared_ptr
<
spdlog
::
logger
>
create_async
(
std
::
string
logger_name
,
SinkArgs
&&
...
sink_args
)
{
return
async_factory
::
create
<
Sink
>
(
logger_name
,
std
::
forward
<
SinkArgs
>
(
sink_args
)...);
return
async_factory
::
create
<
Sink
>
(
std
::
move
(
logger_name
)
,
std
::
forward
<
SinkArgs
>
(
sink_args
)...);
}
template
<
typename
Sink
,
typename
...
SinkArgs
>
inline
std
::
shared_ptr
<
spdlog
::
logger
>
create_async_nb
(
const
std
::
string
&
logger_name
,
SinkArgs
&&
...
sink_args
)
inline
std
::
shared_ptr
<
spdlog
::
logger
>
create_async_nb
(
std
::
string
logger_name
,
SinkArgs
&&
...
sink_args
)
{
return
async_factory_nonblock
::
create
<
Sink
>
(
logger_name
,
std
::
forward
<
SinkArgs
>
(
sink_args
)...);
return
async_factory_nonblock
::
create
<
Sink
>
(
std
::
move
(
logger_name
)
,
std
::
forward
<
SinkArgs
>
(
sink_args
)...);
}
// set global thread pool.
...
...
include/spdlog/details/async_logger_impl.h
View file @
c465250c
...
...
@@ -18,20 +18,20 @@ template<typename It>
inline
spdlog
::
async_logger
::
async_logger
(
std
::
string
logger_name
,
It
begin
,
It
end
,
std
::
weak_ptr
<
details
::
thread_pool
>
tp
,
async_overflow_policy
overflow_policy
)
:
logger
(
std
::
move
(
logger_name
),
begin
,
end
)
,
thread_pool_
(
tp
)
,
thread_pool_
(
std
::
move
(
tp
)
)
,
overflow_policy_
(
overflow_policy
)
{
}
inline
spdlog
::
async_logger
::
async_logger
(
std
::
string
logger_name
,
sinks_init_list
sinks_list
,
std
::
weak_ptr
<
details
::
thread_pool
>
tp
,
async_overflow_policy
overflow_policy
)
:
async_logger
(
std
::
move
(
logger_name
),
sinks_list
.
begin
(),
sinks_list
.
end
(),
tp
,
overflow_policy
)
:
async_logger
(
std
::
move
(
logger_name
),
sinks_list
.
begin
(),
sinks_list
.
end
(),
std
::
move
(
tp
)
,
overflow_policy
)
{
}
inline
spdlog
::
async_logger
::
async_logger
(
std
::
string
logger_name
,
sink_ptr
single_sink
,
std
::
weak_ptr
<
details
::
thread_pool
>
tp
,
async_overflow_policy
overflow_policy
)
:
async_logger
(
std
::
move
(
logger_name
),
{
s
ingle_sink
},
tp
,
overflow_policy
)
:
async_logger
(
std
::
move
(
logger_name
),
{
s
td
::
move
(
single_sink
)},
std
::
move
(
tp
)
,
overflow_policy
)
{
}
...
...
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