A
ambidexterous
public class Program
{
static void Main(string[] args)
{
Debug.Listeners.Add(new ConsoleTraceListener());
Debug.AutoFlush = false;
Debug.WriteLine("Some debug info");
Console.WriteLine("There is no impact! Nothing is going to be
terminated/cancelled");
Console.WriteLine("Debug data:");
Console.WriteLine();
Debug.Flush();
}
}
Why are program above producing this output:
[Console output:]
Some debug info
There is no impact! Nothing is going to be terminated/cancelled
Debug data:
Instead of this output:
[Console output:]
There is no impact! Nothing is going to be terminated/cancelled
Debug data:
Some debug info
I don't get it. I expected that AutoFlush = false, means that data from
memory buffer is going to be written to the trace listener only on call of
Flush(), why then i get it before Flush is called?
{
static void Main(string[] args)
{
Debug.Listeners.Add(new ConsoleTraceListener());
Debug.AutoFlush = false;
Debug.WriteLine("Some debug info");
Console.WriteLine("There is no impact! Nothing is going to be
terminated/cancelled");
Console.WriteLine("Debug data:");
Console.WriteLine();
Debug.Flush();
}
}
Why are program above producing this output:
[Console output:]
Some debug info
There is no impact! Nothing is going to be terminated/cancelled
Debug data:
Instead of this output:
[Console output:]
There is no impact! Nothing is going to be terminated/cancelled
Debug data:
Some debug info
I don't get it. I expected that AutoFlush = false, means that data from
memory buffer is going to be written to the trace listener only on call of
Flush(), why then i get it before Flush is called?