예제 #1
0
파일: Program.cs 프로젝트: Ingvar999/spp_1
        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();
        }