Skip to content

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. void WarnException(string? message, Exception exception)
  • 2. void WarnException(Func<string> function, Exception exception)

1. Overload

Deprecated

Use void Warn(Exception exception, [Localizable(false)] string? message)

Attributes: [Obsolete("Use void Warn(Exception exception, [Localizable(false)] string? message)")]

void WarnException(string? message, Exception exception)

Summary: Emits a warning log message. This will emit details about a exception. This type of logging is not able to be localized.

Parameters

NameTypeDescription
messagestring?A message to emit.
exceptionExceptionThe exception which to emit in the log.

2. Overload

Deprecated

Use void Warn(Exception exception, Func function)

Attributes: [Obsolete("Use void Warn(Exception exception, Func<string> function)")]

void WarnException(Func<string> function, Exception exception)

Summary: Sends the value provided by the provided delegate, only if Warn is enabled.

Parameters

NameTypeDescription
functionFuncThe function to evaluate if Warn logging is enabled.
exceptionExceptionA exception to log about.