Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hueman domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/CloudIngenium.com/htdocs/wp-includes/functions.php on line 6114
.Net: Supported Console Colors – Knowledge eXchange

.Net: Supported Console Colors

.Net: Supported Console Colors

The days of writing applications that write to the console seem to be over for a while now. Notwithstanding, we find ourselves using the console from time to time to help us debug or quickly test application logic. In my case, I am currently using the console to monitor logging information from my application. It is terribly useful to be able to see progress as it happens. It sort of reminds me of using tail -f in Ubuntu against a log file. As part of my effort to make this log reading more easy I decided I wanted to color code the messages based on what they were: Errors / Warnings / Info / Debug, etc. I kept asking myself if Windows is able to support colored console as Ubuntu does, and I am happy to report it does! So here is when the question arises:

What colors are supported and how to use them?

Thankfully there is an enumeration to help us answer this question:

ConsoleColor

Member name Description
Black

The color black.

Blue

The color blue.

Cyan

The color cyan (blue-green).

DarkBlue

The color dark blue.

DarkCyan

The color dark cyan (dark blue-green).

DarkGray

The color dark gray.

DarkGreen

The color dark green.

DarkMagenta

The color dark magenta (dark purplish-red).

DarkRed

The color dark red.

DarkYellow

The color dark yellow (ochre).

Gray

The color gray.

Green

The color green.

Magenta

The color magenta (purplish-red).

Red

The color red.

White

The color white.

Yellow

The color yellow.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.