Author Topic: Export log text in real time?  (Read 3023 times)

WillRiker2701

  • Newbie
  • *
  • Posts: 14
Export log text in real time?
« on: January 19, 2024, 05:19:51 PM »
Hi, I've managed to create a tool that works as a virtual copilot for MSFS. It uses a plugin that I've written to communicate directly with MSFS and the log of VoiceAttack as the "User interface" that shows all the important information of what is the copilot doing and other relevant data that will be useful for the flight. I'm thinking that a next step could be creating an MSFS widget that shows this information live ingame. One way would be to write this information to a text file within the VoiceAttack algorithm and then pick it up in the other application, but my profiles are so extensive that adding this new action to every line where there's text going into the log would be an extensive and very inefficient work. On the other hand, capturing the same information that the VoiceAttack log shows and displaying it inside the game would be ideal. Do you think there's currently a way to do this? Is there for example some text file that gets written paragraph by paragraph what the log says live?
I'm sharing an image of what kind of stuff the log is usually showing within my tool so you can get the idea.

Cheers!


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2831
Re: Export log text in real time?
« Reply #1 on: January 19, 2024, 05:55:59 PM »
There is no current, specific way to do what you are needing, but if you are handy with VA's inline functions or plugin architecture, you can probably make that happen by handling the 'LogEntryAdded' action.   Any time a log entry is added, the 'LogEntryAdded' action is executed, which includes the log message, time and icon color.

Here is a sample using an inline function:


Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

public class VAInline
{
    public void main()
    {
        VA.LogEntryAdded += MyLogEntryAction;
    }

    public void MyLogEntryAction(DateTime theDate, String theMessage, String theIconColor)
    {
         //buffer and write log info to file here
    }
}

WillRiker2701

  • Newbie
  • *
  • Posts: 14
Re: Export log text in real time?
« Reply #2 on: January 20, 2024, 02:21:51 PM »
Thank you so much, this was very useful.