-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for not outputting color to terminal (#44)
This is required when the output is piped into a file or a program.
- Loading branch information
Showing
2 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Add support for not colorizing the terminal output | ||
|
||
Prior to this change any error message called via `PegFormatError.console` | ||
would return an error message with ANSI escape sequence code for coloring. This | ||
created a problem when piping the output to something other than a terminal. | ||
|
||
This change adds the ability to remove ANSI escape sequence codes from the | ||
output. The change is non-breaking as the default behavior is to colorize | ||
the output. The colorization can be turned off by supplying `false` to | ||
the `colorize` parameter: | ||
|
||
```pony | ||
PegFormatError.console(error, false) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters