omniaretail / nimator

Light-weight adhoc framework for creating monitoring apps with c-sharp based system-checks.
MIT License
10 stars 9 forks source link

NimatorResult.RenderPlainText doesn't include Warnings for notifiers that want it #3

Closed jeroenheijmans closed 8 years ago

jeroenheijmans commented 8 years ago

An INotifier typically has a threshold (it probably does if it uses the NotifierSettings base class). The built in notifiers use this to decide whether to actually send out the grand result of a cycle.

However, the actual message is typically created using INimatorResult.RenderPlainText, which in turn calls ToString on the inner LayerResults (see also #2 on that topic), which has a hard-coded assumption about the level for which the ICheckResult details are rendered:

public override string ToString()
{
    var checkErrors = CheckResults
        .Where(r => r.Level >= NotificationLevel.Error)
        .Select(r => r.ToString());
// etc.

This effectively means a INotifier that has a threshold of Warning will still not send out the contents of warning check results.

Probably the RenderPlainText needs to be supplied a threshold, which can be passed down to the other render methods, to display the appropriate information? Again, see also #2.