Ejemplo n.º 1
0
 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
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 7
0
 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);
         }
     });
 }
Ejemplo n.º 8
0
        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;
                }
            }
        }
Ejemplo n.º 10
0
 static void Logger_LogReceived(object sender, LogReceivedEventArgs e)
 {
     Console.WriteLine(e.Message);
 }
Ejemplo n.º 11
0
 private void LoggingConfiguration_LogReceived(object sender, LogReceivedEventArgs e)
 {
     InvokeUI(() => Logs.Insert(0, new LogEventVM(e.LogEvent, e.FormatProvider)));
 }
Ejemplo n.º 12
0
 static void pebble_LogReceived(object sender, LogReceivedEventArgs e)
 {
     Console.WriteLine(e);
 }
Ejemplo n.º 13
0
        public void Log(LogReceivedEventArgs logReceivedEvent)
        {
            string message = _logMessageCreator.CreateMessage(logReceivedEvent.LogInfo);

            Console.WriteLine(message);
        }
Ejemplo n.º 14
0
 private void GlobalLogger_LogMessageReceived(object sender, LogReceivedEventArgs e)
 {
     Console.WriteLine(e.Message);
 }
Ejemplo n.º 15
0
 public async Task OnLogReceivedEvent(object sender, LogReceivedEventArgs eventArgs)
 {
     Logger.Information($"TransactionId: {eventArgs.TransactionId} ; Message: {eventArgs.Message}.");
 }
Ejemplo n.º 16
0
 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;
     }
 }
Ejemplo n.º 19
0
        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);
 }