Mercurial > pub > ImplabNet
comparison 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 |
comparison
equal
deleted
inserted
replaced
92:4c0e5ef99986 | 93:dc4942d09e74 |
---|---|
1 using System; | |
2 using Implab.Diagnostics; | |
3 using Implab.Parallels; | |
4 using Implab; | |
5 | |
6 namespace MonoPlay { | |
7 class MainClass { | |
8 public static void Main(string[] args) { | |
9 var listener = new ConsoleTraceListener(true); | |
10 listener.Subscribe<TraceEvent>(); | |
11 | |
12 MTComponentContainer.AppContainer.Add(listener); | |
13 | |
14 TraceLog.StartLogicalOperation("program"); | |
15 | |
16 Console.WriteLine("Hello World!"); | |
17 | |
18 TraceLog.StartLogicalOperation("async"); | |
19 AsyncPool.Invoke(() => { | |
20 TraceLog.TraceInformation("Hello async"); | |
21 TraceLog.StartLogicalOperation(); | |
22 return 0; | |
23 }) | |
24 .EndLogicalOperation() | |
25 .Join(); | |
26 | |
27 TraceLog.EndLogicalOperation(); | |
28 | |
29 } | |
30 } | |
31 } |