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
b393715b
Commit
b393715b
authored
Sep 26, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added virtual protected functions to base_sink
parent
5ec4e604
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
include/spdlog/sinks/base_sink.h
include/spdlog/sinks/base_sink.h
+13
-3
No files found.
include/spdlog/sinks/base_sink.h
View file @
b393715b
...
...
@@ -30,7 +30,7 @@ public:
base_sink
(
const
base_sink
&
)
=
delete
;
base_sink
&
operator
=
(
const
base_sink
&
)
=
delete
;
void
log
(
const
details
::
log_msg
&
msg
)
final
void
log
(
const
details
::
log_msg
&
msg
)
final
override
{
std
::
lock_guard
<
Mutex
>
lock
(
mutex_
);
sink_it_
(
msg
);
...
...
@@ -45,18 +45,28 @@ public:
void
set_pattern
(
const
std
::
string
&
pattern
)
final
override
{
std
::
lock_guard
<
Mutex
>
lock
(
mutex_
);
formatter_
=
std
::
unique_ptr
<
spdlog
::
formatter
>
(
new
pattern_formatter
(
pattern
)
);
set_pattern_
(
pattern
);
}
void
set_formatter
(
std
::
unique_ptr
<
spdlog
::
formatter
>
sink_formatter
)
final
override
{
std
::
lock_guard
<
Mutex
>
lock
(
mutex_
);
formatter_
=
std
::
move
(
sink_formatter
);
set_formatter_
(
std
::
move
(
sink_formatter
)
);
}
protected:
virtual
void
sink_it_
(
const
details
::
log_msg
&
msg
)
=
0
;
virtual
void
flush_
()
=
0
;
virtual
void
set_pattern_
(
const
std
::
string
&
pattern
)
{
formatter_
=
spdlog
::
make_unique
<
spdlog
::
pattern_formatter
>
(
pattern
);
}
virtual
void
set_formatter_
(
std
::
unique_ptr
<
spdlog
::
formatter
>
sink_formatter
)
{
formatter_
=
std
::
move
(
sink_formatter
);
}
Mutex
mutex_
;
};
}
// namespace 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