using System; using System.Diagnostics; using System.Threading; using Implab.Diagnostics; using Xunit; namespace Implab.Test { using static Trace; public class UnitTest1 { [Fact] public void Test1() { var listener = new TextWriterTraceListener(Console.Out); var source = TraceSource; source.Switch.Level = SourceLevels.All; source.Listeners.Add(listener); Trace.Listeners.Add(listener); Trace.WriteLine("Hello!"); StartLogicalOperation(); Trace.WriteLine("Inner"); foreach(var x in Trace.CorrelationManager.LogicalOperationStack) Trace.WriteLine($"-{x}"); Log("source event"); listener.IndentLevel = 1; source.TraceData(TraceEventType.Start, 1, DateTime.Now); StopLogicalOperation(); } } }