Пример #1
0
        /// <summary>
        ///     Synchronously flushes all logger's output buffers (which implement <see cref="IFlushableLogReceiver"/>)
        /// </summary>
        public static Task FlushAllAsync()
        {
            IEnumerable <IFlushableLogReceiver> flushableLogReceivers;

            lock (LockObject)
            {
                flushableLogReceivers = Receivers.OfType <IFlushableLogReceiver>();
            }
            var flushTasks = flushableLogReceivers.Select(r => r.FlushAsync()).ToArray();

            return(Task.WhenAll(flushTasks));
        }