private void Logger_MessageReceived(object sender, LogReceivedEventArgs e) { if (!this.IsHandleCreated) { return; } try { Invoke(new MethodInvoker(() => { try { if (txtLog.Text.Length > 15000) { txtLog.Clear(); } if (!string.IsNullOrEmpty(e.AltSender)) { txtLog.AppendText(string.Format("{2}{0} - {1}", e.AltSender, e.Message, Environment.NewLine)); } else { txtLog.AppendText(string.Format("{2}[{0} - {3}] - {1}", e.Sender.Name, e.Message, Environment.NewLine, e.Sender.Version)); } } catch (Exception) { } })); } catch (Exception) { // Invalid operation stuff } }
public void Log(LogReceivedEventArgs logReceivedEvent) { var azureFileDirectory = _azureService.GetCloudFileDirectoryByEvent(logReceivedEvent.LogInfo.LogEvent); if (azureFileDirectory == null) { return; } var fileConfig = _fileConfigContainer.Get(logReceivedEvent.LogInfo.LogEvent); if (fileConfig == null) { return; } CloudFile file = azureFileDirectory.GetFileReference(fileConfig.FileName); string filePath = Path.Combine(fileConfig.LogPath, fileConfig.FileName); if (File.Exists(filePath)) { throw new FileNotFoundException($"{filePath} not found."); } using (var fileStream = File.OpenRead(filePath)) { file.UploadFromStream(fileStream); } }
static async void OnNodeLogReceived(object?sender, LogReceivedEventArgs e) { if (_hubContext != null) { await _hubContext.Clients.All.SendAsync("ReceiveLog", e.ID, e.Log); } }
void svc_MessageReceived(object sender, LogReceivedEventArgs e) { Log log = e.Log; if (LogReceived != null) { LogReceived(this, e); } }
void embeddedLogger_LogReceived(object sender, LogReceivedEventArgs e) { if (Deployment.Current.Dispatcher.CheckAccess()) { ProcessEvent(e.Log); } else { Deployment.Current.Dispatcher.BeginInvoke(() => ProcessEvent(e.Log)); } }
void logger_LogReceived(object sender, LogReceivedEventArgs e) { if (Dispatcher.CheckAccess()) { DoSomethingWithLog(e.Log); } else { Dispatcher.BeginInvoke(() => DoSomethingWithLog(e.Log)); } }
private void Receiver_LogReceived(object sender, LogReceivedEventArgs e) { DispatcherHelper.CheckBeginInvokeOnUI(() => { lock (ViewModelConstants.SYNC_OBJECT) { // Add a log entry only to the list if global logging is active (checkbox) if (!IsActive) { return; } LogViewModel log = ToLogViewModel(e.Log); LogsToInsert.Add(log); } }); }
public void Log(LogReceivedEventArgs logReceivedEvent) { IFileConfig currentConfig = _fileConfigContainer.Get(logReceivedEvent.LogInfo.LogEvent); if (currentConfig == null) { throw new ConfigurationErrorsException($"{System.Enum.GetName(typeof(LogEvent), logReceivedEvent.LogInfo.LogEvent)} is not supported"); } _fileAnalyzer.FileName = currentConfig.FileName; _fileAnalyzer.LogPath = currentConfig.LogPath; _fileAnalyzer.FileSizeLimit = currentConfig.FileSizeLimit; string logFile = _fileAnalyzer.GetLogFile(); string message = _logMessageCreator.CreateMessage(logReceivedEvent.LogInfo); File.AppendAllText(logFile, message + System.Environment.NewLine); }
private void LoggerMessageReceeived(object sender, LogReceivedEventArgs e) { if (!CanLoadModels) { TranscribeStatus = TranscribeStatus + Environment.NewLine + e.Message; } else if (!CanLoadGrammar) { GrammarStatus = GrammarStatus + Environment.NewLine + e.Message; } if (e.Type == LogType.Error) { if (!CanListen) { CanLoadGrammar = true; } if (!CanTranscribe) { CanLoadModels = true; } } }
static void Logger_LogReceived(object sender, LogReceivedEventArgs e) { Console.WriteLine(e.Message); }
private void LoggingConfiguration_LogReceived(object sender, LogReceivedEventArgs e) { InvokeUI(() => Logs.Insert(0, new LogEventVM(e.LogEvent, e.FormatProvider))); }
static void pebble_LogReceived(object sender, LogReceivedEventArgs e) { Console.WriteLine(e); }
public void Log(LogReceivedEventArgs logReceivedEvent) { string message = _logMessageCreator.CreateMessage(logReceivedEvent.LogInfo); Console.WriteLine(message); }
private void GlobalLogger_LogMessageReceived(object sender, LogReceivedEventArgs e) { Console.WriteLine(e.Message); }
public async Task OnLogReceivedEvent(object sender, LogReceivedEventArgs eventArgs) { Logger.Information($"TransactionId: {eventArgs.TransactionId} ; Message: {eventArgs.Message}."); }
internal static void PublishLog(LogReceivedEventArgs e) { hubContext.Clients.All.LogReceived(new LogEventVM(e.LogEvent, e.FormatProvider)); }
static void LogReceived (object sender, LogReceivedEventArgs e) { Console.WriteLine (e.Message); }
private void LoggerMessageReceeived(object sender, LogReceivedEventArgs e) { if (!CanLoadModels) { TranscribeStatus = TranscribeStatus + Environment.NewLine + e.Message; } else if (!CanLoadGrammar) { GrammarStatus = GrammarStatus + Environment.NewLine + e.Message; } if (e.Type == LogType.Error) { if (!CanListen) CanLoadGrammar = true; if (!CanTranscribe) CanLoadModels = true; } }
private void LoggingConfiguration_LogReceived(object sender, LogReceivedEventArgs e) { LogEventVM logVM = new LogEventVM(e.LogEvent, e.FormatProvider); InvokeUI(() => { Logs.Add(logVM); }); }
void externalLogger_LogReceived(object sender, LogReceivedEventArgs e) { ProcessEvent(e.Log); }