Skip to content

Commit 61c3521

Browse files
authored
More cautious legacy_color conversion in Logging (#53280)
Can be seen as a follow-on from #51829, also wants JuliaLang/StyledStrings.jl#37 to behave as expected.
1 parent 7fcf9c8 commit 61c3521

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/Logging/src/ConsoleLogger.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ function handle_message(logger::ConsoleLogger, level::LogLevel, message, _module
148148
# Format lines as text with appropriate indentation and with a box
149149
# decoration on the left.
150150
color, prefix, suffix = logger.meta_formatter(level, _module, group, id, filepath, line)::Tuple{Union{Symbol,Int},String,String}
151-
color = StyledStrings.Face(foreground=StyledStrings.Legacy.legacy_color(color))
151+
lcolor = StyledStrings.Legacy.legacy_color(color)
152+
if !isnothing(lcolor)
153+
color = StyledStrings.Face(foreground=lcolor)
154+
end
152155
minsuffixpad = 2
153156
buf = IOBuffer()
154157
iob = IOContext(buf, stream)

0 commit comments

Comments
 (0)