Skip to content

Logging Guidance

Joel Verhagen edited this page Feb 29, 2016 · 8 revisions

This spec covers Logging in NuGet.exe and NuGet.CommandLine.Xplat as it appears in the console and output streams

  1. Logging will keep a prefix of the log level: info, warn, error and the like next to each method showing in the console. This allows for understanding the logs if they get piped into a file/
  2. Logging will write all messages to the output stream, STDOUT, only and never to the error stream, STDERR.
  3. An error summary will be produced and will be written to the error stream so scripts can pivot on errors written as a way to determine a failure.
  4. Warnings will not be written to the error stream but will be summarized to the output stream.
  5. Summaries will be written without any log level prefix, to make it easily human readable.
  6. Colors will be applied in the console where appropriate. For example, errors will be written in red.

Longer term, we might consider adding pivots to log messages to associate them with the project, the package, target (RID + TxM), or even the particular HTTP call made. There is a bug open to suggest a single integer can represent the stream of work, but I think we actually need 2 or 3 of them as specified above.

Contributing

What's Being Worked On?

Check out the proposals in the accepted & proposed folders on the repository, and active PRs for proposals being discussed today.

Common Problems

Clone this wiki locally