logging: Tag Helpers: MVC Tag Helpers should log warnings #1686
Description
Generally speaking, Tag Helpers should only throw runtime exceptions due to bad input, e.g. the AnchorTagHelper
should throw if the value specified for asp-controller
isn't a valid controller name.
However there are many other cases where it would be helpful to notify the user of the helper's decision to no-op or otherwise, even when it isn't an error case, e.g. <label asp-for="FirstName" for="FirstName">First Name:</label>
this will effectively no-op the LabelTagHelper
as the for
attribute and label display text have been specifically supplied and will be honored.
In these cases the Tag Helpers should log a warning. It should be done in such a way that someone viewing the logs could filter to show all warnings from all the MVC Tag Helpers, or specific Tag Helpers, e.g. only show warnings from the InputTagHelper
.