Expose verbosity argument for diagnostic messages
- Dominant language
- C#
- Stars
- 392
- Forks
- 128
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
The linker flag `--verbose` will enable logging of diagnostic messages using `LogMessage`. We should decide how we want to support customizing the verbosity of these messages. This was brought up in https://github.com/xamarin/xamarin-android/pull/5748#discussion_r623001604.
Some background:
Any messages which are simply printed to stdout like with `LogMessages` will get the MSBuild importance defined by ToolTask - the default is `Low`. MSBuild loggers get to decide how to display these, but the default console logger will show `Low` importance messages with MSBuild verbosity detailed or higher. A slightly more detailed explanation is in https://github.com/mono/linker/issues/1030#issuecomment-606292840 and the related discussion.
If we want to support different levels of details in our diagnostic messages, it needs to be done by passing a verbosity argument to the linker, controlled by a property, maybe `TrimmerVerbosity`, in the SDK. The simplest thing to do would just be to make it a boolean, matching the on/off behavior of `--verbose`.
Other alternatives are to always emit the diagnostic messages (there was a desire not to introduce another knob for this in https://github.com/mono/linker/issues/1030#issuecomment-606479320), or to have different "log levels" controlled by an integer or similar.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.