Open haf opened 6 years ago
Since it's mutated on running the tests, it causes things printed before the tests to have no colour
The ANSI Console Writer can't be used in more than a single place in a process, because it has side-effects... The refactoring done 1bb391c is good, but only a small step towards completing this PR; this code needs to be coordinated between loggers/Facades.
// since this executes on module load, it will be the original stdout
stdout.Flush()
let encoding = stdout.Encoding
let std s = prettyPrint true true [s, foregroundColor]
Console.SetOut (new FuncTextWriter(encoding, std))
let errorEncoding = stderr.Encoding
let errorToOutput s = prettyPrint true true [s, ConsoleColor.Red]
Console.SetError (new FuncTextWriter(errorEncoding, errorToOutput))
To Logary Facade to be used elsewhere.
Checklist