AsyncTargetWrapper 的 NLog 文档显示了在示例完成写入日志后对wrapper.Flush() 的调用(不带参数)。但 AsyncTargetWrapper 的 Flush() 方法需要 AsyncContinuation 类型的参数。该类的文档没有说明它的用途或如何使用它。我也找不到这样的例子。有人可以告诉我如何使用 Flush() 吗?
非常感谢。
最佳答案
我在 documentation 中找到了这个和 source code :
AsyncContinuation Delegate
Asynchronous continuation delegate - function invoked at the end of asynchronous processing.
示例似乎很少,但您可以找到有关如何使用它的更多信息 here .
关于logging - NLog:如何刷新 AsyncTargetWrapper?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33223657/