| | | 1 | | using Serilog; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Heimdall.WebApi; |
| | | 4 | | |
| | | 5 | | internal static class ConfigurationWarnings |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Warns that a numeric setting was present but unusable and its default applied instead. Absent |
| | | 9 | | /// is not a fallback, so <paramref name="rejectedValue" /> is <c>null</c> for it and nothing is |
| | | 10 | | /// logged. None of these values is a secret, so the rejected text is logged as written. |
| | | 11 | | /// </summary> |
| | | 12 | | internal static void WarnOnFallback(string variable, string? rejectedValue, double defaultSeconds) |
| | | 13 | | { |
| | 3878 | 14 | | if (rejectedValue is null) |
| | | 15 | | { |
| | 3878 | 16 | | return; |
| | | 17 | | } |
| | | 18 | | |
| | 0 | 19 | | Log.Warning( |
| | 0 | 20 | | "Ignoring unusable {Variable}={Value}; using the default of {Default} seconds", |
| | 0 | 21 | | variable, rejectedValue, defaultSeconds); |
| | 0 | 22 | | } |
| | | 23 | | } |