Skip to content

Commit

Permalink
More cautious legacy_color conversion in Logging (JuliaLang#53280)
Browse files Browse the repository at this point in the history
Can be seen as a follow-on from JuliaLang#51829, also wants
JuliaLang/StyledStrings.jl#37
 to behave as expected.
  • Loading branch information
tecosaur committed Mar 4, 2024
1 parent 879772f commit 46ef213
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stdlib/Logging/src/ConsoleLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ function handle_message(logger::ConsoleLogger, level::LogLevel, message, _module
# Format lines as text with appropriate indentation and with a box
# decoration on the left.
color, prefix, suffix = logger.meta_formatter(level, _module, group, id, filepath, line)::Tuple{Union{Symbol,Int},String,String}
color = StyledStrings.Face(foreground=StyledStrings.Legacy.legacy_color(color))
lcolor = StyledStrings.Legacy.legacy_color(color)
if !isnothing(lcolor)
color = StyledStrings.Face(foreground=lcolor)
end
minsuffixpad = 2
buf = IOBuffer()
iob = IOContext(buf, stream)
Expand Down

0 comments on commit 46ef213

Please sign in to comment.