void Log_GlobalWriteToExternalLog(string formattedMessage, CoreLib.Diagnostics.LogEntryType type, object extra) { if (ScreenInitialized) { Log.GlobalWriteToExternalLog -= Log_GlobalWriteToExternalLog; return; } SbLog.AppendLine(DateTime.Now.ToFullString() + "\t" + formattedMessage); }
void Log_GlobalWriteToExternalLog(string formattedMessage, CoreLib.Diagnostics.LogEntryType type, object extra) { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "Log_GlobalWriteToExternalLog")) { try { Dispatcher.Invoke(new Action(() => { if (type == CoreLib.Diagnostics.LogEntryType.Exception) { if (axConsole.Exceptions.Count >= 32767) { axConsole.Exceptions.Clear(); } ExceptionModel item = new ExceptionModel() { SNo = axConsole.Exceptions.Count + 1, ReceivedTime = DateTime.Now, Exception = formattedMessage, }; axConsole.Exceptions.Add(item); } if (axConsole.Output.Length > 32767) { axConsole.Output = string.Empty; } axConsole.Output += DateTime.Now.ToFullString() + "\t" + formattedMessage + Environment.NewLine; axConsole.ScrollToEnd(); })); } catch (Exception ex) { method.Exception(ex); } } }