(5 comments)

Highlighting or coloring output in MOOSE is now easy to use. There are several color macro names that can be inserted into any stream object.

_console 
   << "The following value is very important: " 
   << COLOR_GREEN << _some_value << COLOR_DEFAULT << '\n';
  • When using the color macros it is important to always switch the color back to the default using COLOR_DEFAULT before completing your stream output.
  • MOOSE automatically disables color when the terminal type cannot be detected.
  • By default mooseError() and mooseWarning() messages will be colored on your terminal.
  • To manually disable coloring simply use the --no-color option on the command line when running your application.
  • The following colors macros are available for general use:
 COLOR_BLACK
 COLOR_RED
 COLOR_GREEN
 COLOR_YELLOW
 COLOR_BLUE
 COLOR_MAGENTA
 COLOR_CYAN
 COLOR_WHITE
 COLOR_DEFAULT
Current rating: 5

Comments

Lei Zhao 3 years, 5 months ago

Sounds COOOOOOOL!

Link | Reply
Current rating: 5

Danielle Perez 3 years, 5 months ago

I suggest to let the user specify the use_color option within the input file unless you guys are planning on fixing the issue where the color does not get printed when the console output is sent to stdlog and stderr files. I always save my log file when doing BISON validation so I can look through the convergence history, it is hard to figure out what is going on when the "color" is printed out as "ESC[32m9.965709e+01ESC[39m". It seems with this new and improved color system that you can no longer turn off the color within the input file. If there is a way to do it, please let me know.

Thanks!

Danielle

Link | Reply
Currently unrated

Case Studies Analysis 3 months, 2 weeks ago

I personally like your post, you have shared good article. It will help me in great deal.

Link | Reply
Currently unrated

harding barry 3 months, 1 week ago

I personally like your post,

Link | Reply
Currently unrated

blackheads being removed 2 months, 3 weeks ago

Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any suggestions? Many thanks!

Link | Reply
Currently unrated

New Comment

required

required (not published)

optional

R&D 100

Recent Blog Posts

Using our new clang-format Style

8 months, 2 weeks ago

Steady State Algorithm Change

1 year, 5 months ago

Making an App inherit from an App

1 year, 5 months ago

Changing a published API (Deprecation)

1 year, 6 months ago

DiscreteMaterial Objects

1 year, 8 months ago

Recent Posts

Archive

2017
2016
2015
2014

Tags

Authors

Feeds

RSS / Atom