Closed rumpuslabs closed 1 year ago
Thanks! Does this mean that colour escape codes in the output won't be present if Write
-ing to something like String
?
No, they will be present if Write
-ing to a String
, the same as they are now. If feature = "concolor"
, then ariadne::Fmt
will assume (for the purposes of concolor
's interactive terminal detection) that the String
will eventually be written to stderr
. If that assumption is incorrect, the user can use ariadne::StdoutFmt
instead to get the opposite assumption. If both stdout
and stderr
are interactive terminals (or concolor
has not(feature = "interactive")
), then it makes no difference.
Thanks!
I started writing my own trait to wrap
ariadne::Fmt
to turn coloring on and off usingconcolor
and then thought, why not push it upstream? I've made it an optional feature for backwards compatibility.For the purposes of
concolor
's interactive terminal detection I've assumed that existing projects are writing tostderr
but if they're not, they can switch tostdout
by doinguse ariadne::StdoutFmt
instead ofuse ariadne::Fmt
.