93f4ac0a83
The CFEs FormattedMessage always had two getters to get the text inside one that would supposedly give an ansi formated version of the message and one that would supposedly give a plaintext formated version of the message. They both returned the same string, though, which would either be with ansi escape codes or plain text depending on the environment at compile time. This CL fixes that by having both messages, and letting the reporting (i.e. whenever the message is read) decide which to use. That way we can - for instance - report errors with color if the terminal supports it correctly when reusing a dill (and reissuing problems, but where the terminal support changes) and if printing the problem to an html <pre> field (like observatory does). It also cleans up two different implementations of whether we think the terminal supports colors or not, by deleting one of them. This is the second try. Patchset #1 is the original. Patchset #2(and possibly beyond) is the changes. TEST=Existing test suites. Change-Id: I8e483049ce81ce1bd8e5396b588a31e0ad3a8630 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187402 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>