private void LogToConsole(MsgLevel level, ErrReport report) { string msg = ""; if (report.StackTrace.Length > 0) { //System.Diagnostics.Trace.WriteLine(String.Format("{0:00000}\t{1}\t{2}.{3} - {4}{5}{6}", report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg, Environment.NewLine, report.StackTrace)); //msg = String.Format("{0:00000}\t{1}\t{2}.{3} - {4}{5}{6}", report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg, Environment.NewLine, report.StackTrace); msg = String.Format( "{0} {1:00000}\t{2}\t{3}.{4} - {5}{6}{7}", report.TimeStamp.ToString("h:mm:ss fff"), report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg, Environment.NewLine, report.StackTrace); } else { //System.Diagnostics.Trace.WriteLine(String.Format("{0:00000}\t{1}\t{2}.{3} - {4}", report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg)); //msg = String.Format("{0:00000}\t{1}\t{2}.{3} - {4}", report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg); msg = String.Format( "{0} {1:00000}\t{2}\t{3}.{4} - {5}", report.TimeStamp.ToString("h:mm:ss fff"), report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg); } System.Diagnostics.Trace.WriteLine(msg); }
private void LogToConsole(MsgLevel level, ErrReport report) { if (report.StackTrace.Length > 0) { Console.WriteLine("{0}\t{1}\t{2}.{3} - {4}{5}{6}", report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg, Environment.NewLine, report.StackTrace); } else { Console.WriteLine("{0}\t{1}\t{2}.{3} - {4}", report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg); } }
public void WriteToConsole(MsgLevel level, ErrReport report) { if (report.StackTrace.Length > 0) { Console.WriteLine("{0} {1}\t{2}\t{3}.{4} - {5}{6}{7}", report.TimeStamp.ToString("h:mm:ss fff"), report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg, Environment.NewLine, report.StackTrace); } else { Console.WriteLine("{0} {1}\t{2}\t{3}.{4} - {5}", report.TimeStamp.ToString("h:mm:ss fff"), report.Code, level.ShortName(), report.AtClass, report.AtMethod, report.Msg); } }