Skip to content

Commit 46ef213

Browse files
committed
More cautious legacy_color conversion in Logging (JuliaLang#53280)
Can be seen as a follow-on from JuliaLang#51829, also wants JuliaLang/StyledStrings.jl#37 to behave as expected.
1 parent 879772f commit 46ef213

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/Logging/src/ConsoleLogger.jl

+4-1
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)