Merged
Conversation
* bout-log-color is a shell script which uses sed to insert text color escape codes. This currently highlights: 1. Any word "warning" or "error" (case insensitive) is turned red 2. The word "default" after options is turned blue 3. The phrase "Command line" after options is turned green The aim of this is to highlight important things to note i.e. when something might be wrong; when the code has set something for you, and for the few settings which you override on the command line If the BOUT-dev "bin" directory is in PATH, then existing log files can be printed using: $ cat BOUT.log.0 | bout-log-color * A command-line option "-c" has been added, which pipes stdout through bout-log-color. This uses posix functions, so should be quite portable. This functionality can be disabled in configure with "--disable-color" if needed. An issue is that if "-c" is used, but bout-log-color is not in PATH, then the code exits. The popen command succeeds, returning a valid pipe, even though the shell command failed.
Member
|
Could the full path to |
dschwoerer
reviewed
Aug 28, 2017
configure.ac
Outdated
| echo "Segmentation fault handling disabled" | ||
| fi | ||
|
|
||
| if test "$enable_signal" != "no" |
Contributor
There was a problem hiding this comment.
enable_signal should be enable_color
dschwoerer
reviewed
Aug 28, 2017
src/bout++.cxx
Outdated
| " -v \t\tIncrease verbosity\n" | ||
| " -q \t\tDecrease verbosity\n" | ||
| #ifdef LOGCOLOR | ||
| " -c \t\tColor output using bout-log-color\n" |
Contributor
There was a problem hiding this comment.
provide long version as well? Both -c and --color?
copy-paste error, using enable_signal rather than enable_color in configure. --color long option added, with same effect as -c
Moved the stdout pipe to after MPI is initialised, then only if MYPE == 0
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a shell script and command-line option ("-c") to color BOUT++ output
bout-log-color is a shell script which uses sed to insert text color escape codes. This currently highlights:
The aim of this is to highlight important things to note
i.e. when something might be wrong; when the code has set something
for you, and for the few settings which you override on the command line
If the BOUT-dev "bin" directory is in PATH, then existing log files can be printed in color using:
$ cat BOUT.log.0 | bout-log-color
A command-line option "-c" has been added, which pipes stdout through bout-log-color. This uses posix functions, so should be quite portable. This functionality can be disabled in configure with "--disable-color" if needed.
An issue is that if "-c" is used, but bout-log-color is not in PATH, then the code exits. The popen command succeeds, returning a valid pipe, even though the shell command failed.