System.Diagnostics.Trace.Flush C# (CSharp) Method

Flush() private method

private Flush ( ) : void
return void
        public static void Flush() { }
        [System.Diagnostics.ConditionalAttribute("TRACE")]

Usage Example

Beispiel #1
0
    public void CanTrace()
    {
        var listener = new Listener();

        Trace.Listeners.Add(listener);
        try
        {
            var logger = new TraceDiagnosticLogger(SentryLevel.Debug);
            logger.Log(SentryLevel.Debug, "the message {0}", new Exception("the exception"), "arg1");
            Trace.Flush();
            Assert.Equal(@"  Debug: the message arg1
System.Exception: the exception", listener.Messages.Single());
        }
        finally
        {
            Trace.Listeners.Remove(listener);
        }
    }