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
ee610efd
Commit
ee610efd
authored
Mar 18, 2016
by
Kevin M. Godby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add assignment operator to ansi color sink. Adjust default colors.
parent
9afc960d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
include/spdlog/sinks/ansicolor_sink.h
include/spdlog/sinks/ansicolor_sink.h
+22
-3
No files found.
include/spdlog/sinks/ansicolor_sink.h
View file @
ee610efd
...
...
@@ -24,6 +24,9 @@ public:
ansicolor_sink
(
sink_ptr
sink
);
virtual
~
ansicolor_sink
();
ansicolor_sink
(
const
ansicolor_sink
&
other
);
ansicolor_sink
&
operator
=
(
const
ansicolor_sink
&
other
);
virtual
void
log
(
const
details
::
log_msg
&
msg
)
override
;
virtual
void
flush
()
override
;
...
...
@@ -72,10 +75,10 @@ protected:
inline
ansicolor_sink
::
ansicolor_sink
(
sink_ptr
sink
)
:
sink_
(
sink
)
{
colors_
[
level
::
trace
]
=
grey
;
colors_
[
level
::
debug
]
=
grey
;
colors_
[
level
::
trace
]
=
white
;
colors_
[
level
::
debug
]
=
white
;
colors_
[
level
::
info
]
=
white
;
colors_
[
level
::
notice
]
=
yellow
;
colors_
[
level
::
notice
]
=
bold
+
white
;
colors_
[
level
::
warn
]
=
bold
+
yellow
;
colors_
[
level
::
err
]
=
red
;
colors_
[
level
::
critical
]
=
bold
+
red
;
...
...
@@ -89,6 +92,22 @@ inline ansicolor_sink::~ansicolor_sink()
flush
();
}
inline
ansicolor_sink
::
ansicolor_sink
(
const
ansicolor_sink
&
other
)
:
sink_
(
other
.
sink_
),
colors_
(
other
.
colors_
)
{
// do nothing
}
inline
ansicolor_sink
&
ansicolor_sink
::
operator
=
(
const
ansicolor_sink
&
other
)
{
if
(
this
==
&
other
)
return
*
this
;
sink_
=
other
.
sink_
;
colors_
=
other
.
colors_
;
return
*
this
;
}
inline
void
ansicolor_sink
::
log
(
const
details
::
log_msg
&
msg
)
{
// Wrap the originally formatted message in color codes
...
...
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