Mercurial > pub > ImplabNet
diff Implab.Test/UnitTest1.cs @ 252:6f4630d0bcd9 v3
removed absolete Diagnostics classes
author | cin |
---|---|
date | Mon, 12 Feb 2018 07:24:31 +0300 |
parents | 7c7e9ad6fe4a |
children | 34df34841225 |
line wrap: on
line diff
--- a/Implab.Test/UnitTest1.cs Sun Feb 11 00:49:51 2018 +0300 +++ b/Implab.Test/UnitTest1.cs Mon Feb 12 07:24:31 2018 +0300 @@ -1,29 +1,37 @@ using System; using System.Diagnostics; using System.Threading; +using Implab.Diagnostics; using Xunit; namespace Implab.Test { + using static Trace<UnitTest1>; public class UnitTest1 { [Fact] public void Test1() { var listener = new TextWriterTraceListener(Console.Out); - var source = new TraceSource("Custom",SourceLevels.ActivityTracing); + var source = TraceSource; + source.Switch.Level = SourceLevels.All; source.Listeners.Add(listener); + Trace.Listeners.Add(listener); - Trace.Listeners.Add(listener); Trace.WriteLine("Hello!"); - Trace.CorrelationManager.StartLogicalOperation(); + StartLogicalOperation(); + Trace.WriteLine("Inner"); foreach(var x in Trace.CorrelationManager.LogicalOperationStack) Trace.WriteLine($"-{x}"); - source.TraceEvent(TraceEventType.Information, 1, "source event"); + Log("source event"); + + listener.IndentLevel = 1; + source.TraceData(TraceEventType.Start, 1, DateTime.Now); - Trace.CorrelationManager.StopLogicalOperation(); + + StopLogicalOperation(); } } }