Example #1
0
        private void ReceivedCollectorSuccess(CollectorMessage.Success message)
        {
            log.Debug("Collector '{0}' reported success for '{1}'", Sender.Path.ToStringWithoutAddress(), message.MovedFilename);
            string name = Path.GetFileName(message.MovedFilename);

            this.uiMessenger.Tell(new UiMessengerMessage.Publish(new EliteDangerous.Journal.EntryMetaMessage(DateTime.UtcNow, EliteDangerous.Journal.Event.MetaMessage, $"Collected: {name}")));
        }
Example #2
0
 private void ReceivedPublish(UiMessengerMessage.Publish message)
 {
     if (log.IsDebugEnabled)
     {
         log.Debug("Publishing message of type '{0}' on UI thread", message.Message.GetType().Name);
     }
     this.eventAggregator.BeginPublishOnUIThread(message.Message);
 }
 private void ReceivedProcessLine(ReaderMessage.ProcessLine message)
 {
     log.Debug("Parsing new line");
     try
     {
         JObject o         = JObject.Parse(message.Line);
         string  tsText    = o["timestamp"].Value <string>();
         string  eventText = o["event"].Value <string>();
         if (String.IsNullOrWhiteSpace(tsText))
         {
             throw new Exception("Timestamp missing");
         }
         if (String.IsNullOrWhiteSpace(eventText))
         {
             throw new Exception("Eventtype missing");
         }
         Event @event = Event.Unknown;
         if (!Enum.TryParse <Event>(eventText, out @event))
         {
             log.Warning($"Event '{eventText}' not supported (yet)");
             @event = Event.Unknown;
         }
         DateTime timestamp = DateTime.Parse(tsText, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind);
         Entry    entry     = CreateEntryFor(o, timestamp, @event);
         if (entry == null)
         {
             return;
         }
         this.connector.Tell(new ConnectorMessage.JournalEntry(entry));
     }
     catch (Exception ex)
     {
         log.Error(ex, $"Failed to parse new line (index {message.Index} in {message.SourceFile})");
         this.connector.Tell(new ReaderMessage.ProcessError(message.Line, $"Failed to parse line index {message.Index} in '{message.SourceFile}': {ex.Message}"));
     }
 }
Example #4
0
 public override void ChannelRegistered(IChannelHandlerContext ctx)
 {
     _log.Debug("Channel {0} registered", ctx.Channel);
     ctx.FireChannelRegistered();
 }
Example #5
0
 public void Debug(string format, params object[] args)
 => _logger.Debug(format, args);