| LoggerSwallow Method (Task) |
Logs an exception is logged at Error level if the provided task does not run to completion.
Namespace:
NLog
Assembly:
NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax public void Swallow(
Task task
)
Public Sub Swallow (
task As Task
)
Dim instance As Logger
Dim task As Task
instance.Swallow(task)
abstract Swallow :
task : Task -> unit
override Swallow :
task : Task -> unit
Parameters
- task
- Type: System.Threading.TasksTask
The task for which to log an error if it does not run to completion.
Implements
ISuppress.Swallow(Task)Remarks This method is useful in fire-and-forget situations, where application logic does not depend on completion of task. This method is avoids C# warning CS4014 in such situations.
See Also