Closed ivanovaleksey closed 6 years ago
Thanks for catching this, I guess I must have broke it at some point. I have a test for log formatting, but not for log colorization -- might be nice to add one.
I like using write!
instead of push_str
and then push
, that seems a little nicer.
Hi @mquander,
I noticed that log messages don't get colored.
After spending some time I found that it is mainly because of how we generate output string. We use
push_str
which requires&str
as a parameter. So, we have to use&
and dereference occurs onColoredString
instance.Due to implementation of
Deref
forColoredString
only raw text gets returned (without any style attributes).I tried to use
write!
and it worked. I also decided to change anotherpush_str
usages towrite!
for consistency.What do you think?
Currently on master:
With this patch: