Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Tracer tracer = new Tracer();

            tracer.StartTrace();
            AnyClass anyObject = new AnyClass(tracer);

            anyObject.AnyMethod();
            tracer.StopTrace();
            tracer.GetTraceResult().threads[0].Id = 0;
            var writer = new TWriter();

            {
                var formatter = new TXmlSerializer();
                writer.WriteToConsole(formatter.Serialize(tracer.GetTraceResult()));
                writer.WriteToFile(formatter.Serialize(tracer.GetTraceResult()), "XmlTrace.XML");
            }
            {
                var formatter = new TJsonSerializer();
                writer.WriteToConsole(formatter.Serialize(tracer.GetTraceResult()));
                writer.WriteToFile(formatter.Serialize(tracer.GetTraceResult()), "JsonTrace.json");
            }
            Console.ReadKey();
        }