The output to the Console should almout always use the ConsoleService to print output out to the console, this could be done in different ways.
Using the Write helper methods in the CommandBase class
- WriteCritical
- WriteWarning
- WriteError
- WriteLine
- and so on...
The output will be displayed in a decided way, warnings wil have a certain color, different from errors, and the output will be logged by default. And they will have log level corresponding to the type of output. WriteLine and Write have the options to be printed out to the console without being logged.
There are situations where Console.Write or WriteLine is useful, if you want to be sure that it will not be logged by mistake, the output of secrets for instance.
Read more about: