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
11e97525
Commit
11e97525
authored
Aug 27, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed logger's copy ctor
parent
72b0f9e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
include/spdlog/details/backtracer.h
include/spdlog/details/backtracer.h
+8
-2
include/spdlog/logger-inl.h
include/spdlog/logger-inl.h
+6
-1
No files found.
include/spdlog/details/backtracer.h
View file @
11e97525
...
@@ -17,13 +17,19 @@ namespace details {
...
@@ -17,13 +17,19 @@ namespace details {
class
backtracer
class
backtracer
{
{
std
::
mutex
mutex_
;
std
::
mutex
mutex_
;
size_t
n_messages_
;
circular_q
<
log_msg_buffer
>
messages_
;
circular_q
<
log_msg_buffer
>
messages_
;
public:
public:
explicit
backtracer
(
size_t
n_message
)
explicit
backtracer
(
size_t
n_message
s
)
:
messages_
{
n_message
}
:
n_messages_
{
n_messages
},
messages_
{
n_messages
}
{}
{}
size_t
n_messages
()
{
return
n_messages_
;
}
void
add
(
const
log_msg
&
msg
)
void
add
(
const
log_msg
&
msg
)
{
{
std
::
lock_guard
<
std
::
mutex
>
lock
{
mutex_
};
std
::
lock_guard
<
std
::
mutex
>
lock
{
mutex_
};
...
...
include/spdlog/logger-inl.h
View file @
11e97525
...
@@ -23,7 +23,12 @@ SPDLOG_INLINE logger::logger(const logger &other)
...
@@ -23,7 +23,12 @@ SPDLOG_INLINE logger::logger(const logger &other)
,
flush_level_
(
other
.
flush_level_
.
load
(
std
::
memory_order_relaxed
))
,
flush_level_
(
other
.
flush_level_
.
load
(
std
::
memory_order_relaxed
))
,
custom_err_handler_
(
other
.
custom_err_handler_
)
,
custom_err_handler_
(
other
.
custom_err_handler_
)
,
tracer_
(
other
.
tracer_
)
,
tracer_
(
other
.
tracer_
)
{}
{
if
(
other
.
tracer_
)
{
enable_backtrace
(
other
.
tracer_
->
n_messages
());
}
}
SPDLOG_INLINE
logger
::
logger
(
logger
&&
other
)
SPDLOG_NOEXCEPT
:
name_
(
std
::
move
(
other
.
name_
)),
SPDLOG_INLINE
logger
::
logger
(
logger
&&
other
)
SPDLOG_NOEXCEPT
:
name_
(
std
::
move
(
other
.
name_
)),
sinks_
(
std
::
move
(
other
.
sinks_
)),
sinks_
(
std
::
move
(
other
.
sinks_
)),
...
...
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