Mercurial > pub > ImplabNet
diff MonoPlay/Program.cs @ 93:dc4942d09e74 v2
improved tracing
added the application components container MTComponentContainer.AppContainer
author | cin |
---|---|
date | Thu, 23 Oct 2014 01:13:57 +0400 |
parents | |
children | a43745f81f10 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MonoPlay/Program.cs Thu Oct 23 01:13:57 2014 +0400 @@ -0,0 +1,31 @@ +using System; +using Implab.Diagnostics; +using Implab.Parallels; +using Implab; + +namespace MonoPlay { + class MainClass { + public static void Main(string[] args) { + var listener = new ConsoleTraceListener(true); + listener.Subscribe<TraceEvent>(); + + MTComponentContainer.AppContainer.Add(listener); + + TraceLog.StartLogicalOperation("program"); + + Console.WriteLine("Hello World!"); + + TraceLog.StartLogicalOperation("async"); + AsyncPool.Invoke(() => { + TraceLog.TraceInformation("Hello async"); + TraceLog.StartLogicalOperation(); + return 0; + }) + .EndLogicalOperation() + .Join(); + + TraceLog.EndLogicalOperation(); + + } + } +}