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
3848cbe2
Commit
3848cbe2
authored
Feb 24, 2020
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1452
parent
15ac7b08
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
include/spdlog/sinks/ansicolor_sink-inl.h
include/spdlog/sinks/ansicolor_sink-inl.h
+1
-1
include/spdlog/sinks/wincolor_sink-inl.h
include/spdlog/sinks/wincolor_sink-inl.h
+1
-1
No files found.
include/spdlog/sinks/ansicolor_sink-inl.h
View file @
3848cbe2
...
@@ -43,7 +43,7 @@ SPDLOG_INLINE void ansicolor_sink<ConsoleMutex>::log(const details::log_msg &msg
...
@@ -43,7 +43,7 @@ SPDLOG_INLINE void ansicolor_sink<ConsoleMutex>::log(const details::log_msg &msg
// Wrap the originally formatted message in color codes.
// Wrap the originally formatted message in color codes.
// If color is not supported in the terminal, log as is instead.
// If color is not supported in the terminal, log as is instead.
std
::
lock_guard
<
mutex_t
>
lock
(
mutex_
);
std
::
lock_guard
<
mutex_t
>
lock
(
mutex_
);
msg
.
color_range_start
=
msg
.
color_range_end
=
0
;
memory_buf_t
formatted
;
memory_buf_t
formatted
;
formatter_
->
format
(
msg
,
formatted
);
formatter_
->
format
(
msg
,
formatted
);
if
(
should_do_colors_
&&
msg
.
color_range_end
>
msg
.
color_range_start
)
if
(
should_do_colors_
&&
msg
.
color_range_end
>
msg
.
color_range_start
)
...
...
include/spdlog/sinks/wincolor_sink-inl.h
View file @
3848cbe2
...
@@ -52,6 +52,7 @@ template<typename ConsoleMutex>
...
@@ -52,6 +52,7 @@ template<typename ConsoleMutex>
void
SPDLOG_INLINE
wincolor_sink
<
ConsoleMutex
>::
log
(
const
details
::
log_msg
&
msg
)
void
SPDLOG_INLINE
wincolor_sink
<
ConsoleMutex
>::
log
(
const
details
::
log_msg
&
msg
)
{
{
std
::
lock_guard
<
mutex_t
>
lock
(
mutex_
);
std
::
lock_guard
<
mutex_t
>
lock
(
mutex_
);
msg
.
color_range_start
=
msg
.
color_range_end
=
0
;
memory_buf_t
formatted
;
memory_buf_t
formatted
;
formatter_
->
format
(
msg
,
formatted
);
formatter_
->
format
(
msg
,
formatted
);
if
(
!
in_console_
)
if
(
!
in_console_
)
...
@@ -59,7 +60,6 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg)
...
@@ -59,7 +60,6 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg)
write_to_file_
(
formatted
);
write_to_file_
(
formatted
);
return
;
return
;
}
}
if
(
should_do_colors_
&&
msg
.
color_range_end
>
msg
.
color_range_start
)
if
(
should_do_colors_
&&
msg
.
color_range_end
>
msg
.
color_range_start
)
{
{
// before color range
// before color range
...
...
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