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
81e82fb2
Commit
81e82fb2
authored
Jul 15, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename func name wincolor sink
parent
c8172544
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
include/spdlog/sinks/wincolor_sink-inl.h
include/spdlog/sinks/wincolor_sink-inl.h
+3
-3
include/spdlog/sinks/wincolor_sink.h
include/spdlog/sinks/wincolor_sink.h
+3
-2
No files found.
include/spdlog/sinks/wincolor_sink-inl.h
View file @
81e82fb2
...
...
@@ -66,7 +66,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg)
print_range_
(
formatted
,
0
,
msg
.
color_range_start
);
// in color range
auto
orig_attribs
=
set_
console_attribs
(
colors_
[
msg
.
level
]);
auto
orig_attribs
=
set_
foreground_color_
(
colors_
[
msg
.
level
]);
print_range_
(
formatted
,
msg
.
color_range_start
,
msg
.
color_range_end
);
// reset to orig colors
::
SetConsoleTextAttribute
(
out_handle_
,
orig_attribs
);
...
...
@@ -115,9 +115,9 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_color_mode(color_mode mode)
}
}
// set color and return the orig console attributes (for resetting later)
// set
foreground
color and return the orig console attributes (for resetting later)
template
<
typename
ConsoleMutex
>
WORD
SPDLOG_INLINE
wincolor_sink
<
ConsoleMutex
>::
set_
console_attribs
(
WORD
attribs
)
WORD
SPDLOG_INLINE
wincolor_sink
<
ConsoleMutex
>::
set_
foreground_color_
(
WORD
attribs
)
{
CONSOLE_SCREEN_BUFFER_INFO
orig_buffer_info
;
::
GetConsoleScreenBufferInfo
(
out_handle_
,
&
orig_buffer_info
);
...
...
include/spdlog/sinks/wincolor_sink.h
View file @
81e82fb2
...
...
@@ -54,8 +54,9 @@ protected:
std
::
unique_ptr
<
spdlog
::
formatter
>
formatter_
;
std
::
unordered_map
<
level
::
level_enum
,
WORD
,
level
::
level_hasher
>
colors_
;
// set color and return the orig console attributes (for resetting later)
WORD
set_console_attribs
(
WORD
attribs
);
// set foreground color and return the orig console attributes (for resetting later)
WORD
set_foreground_color_
(
WORD
attribs
);
// print a range of formatted message to console
void
print_range_
(
const
fmt
::
memory_buffer
&
formatted
,
size_t
start
,
size_t
end
);
...
...
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