Click or drag to resize

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.5.0+1873145cbc26e0312d9481234d69ce7dc68aac4e
Syntax
public void Swallow(
	Task task
)

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