Skip to content

Commit

Permalink
Colorize progress bars (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf authored Jan 28, 2020
1 parent 6523ed7 commit 4af99eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TerminalLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ function handle_progress(logger, message, id, progress)

if progress == "done" || progress >= 1
pop!(logger.sticky_messages, id)
println(logger.stream, bartxt)
printstyled(logger.stream, bartxt; color=:light_black)
println(logger.stream)
else
bartxt = sprint(context = logger.stream) do io
printstyled(io, bartxt; color=:green)
end
push!(logger.sticky_messages, id => bartxt)
end
finally
Expand Down

0 comments on commit 4af99eb

Please sign in to comment.