The log to file visualizer writes all serial data received to a file. For greater control over the content written to file, consider the message logger.
The log to file visualizer configures the path of the log file, start and stops logging and adds time-stamps to lines as they are written.
Creating a Log to File Visualizer
Select Log to File from the visualizer menu or toolbox to create a new visualizer to configure and write a log file.
You can create multiple Log to File visualizers to store data from different connections or write a log to multiple files.
Drag the visualizer tab to organize the windows in your MegunoLink project.
User Interface
The log to file user interface provides controls to choose the log file path start and stop logging, add time-stamps to the lines as they are written.
Visualizer Toolbar
Tool | Description |
---|---|
Connect/disconnect the selected connection. Use the drop-down to select the connection used by this visualizer. | |
Open the drop-down menu to control date and time-stamping new lines appended to the log file. | |
Delete the log file (only available when not writing to the log file). | |
Enable/disable writing the log file. Open the drop-down menu to enable/disable logging automatically when the connection is opened. A red + is displayed on the toolbar button whenever content is written to the file. | |
Open online documentation for the visualizer. |
Log File Path
The log file path is resolved automatically each time the log file is opened. It can reference well known paths, such as your documents, Dropbox or MegunoLink project path, and include the date and/or time.
Click the Configure log path button to open the dialog to view and configure the log file path.
Starting and Stopping Logging
To start logging in MegunoLink, check the Enable logging command on the visualizer toolbar. To stop logging uncheck the Enable logging command.
MegunoLink can also start logging automatically whenever a connection is opened. Simply check the Start logging automatically when connection is opened menu item. This can be combined with the Restore on Load option in the Connection Manager to open a connection and automatically start logging when the MegunoLink project is opened.
Adding Time/Date to Log
The time and/or date can automatically be added to the log file by selecting one or both of the options on the time-stamp menu.
When enabled, the current date and time are written to the start of each line in the log file.
how to add the time stamps in milliseconds?