MegunoLink uses a flexible approach to define the log file path for log to file and message logger visualizers so your MegunoLink project is portable to different computers. The log file path is created from three parts:

  1. base folder,
  2. folder,
  3. filename.

The base folder can refer the computers documents, Dropbox, desktop or your project folder and automatically resolves to the correct location when you start logging. This lets you select a path that will work even if you use the MegunoLink project on computers that use a different file system layout. Both the folder and filename parts can include the date and/or time when the log file is opened.

Open the Configure log path dialog to view or change the parts to the log file path by clicking the Configure log path button on the log to file or message logger visualizers.

Log file path UI

Configure Log Path

Use the Configure Log Path dialog to build a composite path for writing log files.

In the Configure Log Path dialog you can set all the log file parts: the base folder, folder and filename.

Base Path

The base folder defines the first part of the path. You can select from several locations that MegunoLink can work out when the log file is created including:

  • None: Treat the Folder as an absolute path. The base folder is ignored.
  • Project: The log file is saved under the same folder as the MegunoLink project file.
  • Dropbox Folder: The log file is saved under the user’s Dropbox folder.
  • Dropbox Personal Folder: The log file is saved under the user’s personal Dropbox folder.
  • Dropbox Business Folder: The log file is saved under the user’s business Dropbox folder.
  • My Documents: The log file is saved under the user’s documents folder.
  • Desktop: The log file is saved under the user’s Desktop folder.

Folder

The Folder is appended to the base folder, allowing you to select a folder inside the base folder. Use the drop-down menu to include the date and/or time in the folder name.

Filename

The Filename sets the log file’s name. It is appended to the base folder and folder parts. Use the drop-down menu to include the date and/or time in the filename. The filename used by a message logger may be changed from your Arduino sketch (see below).

Checking the Path

Use the Test button to combine all the parts of the log file name to see where the log file will be saved.

Changing the Path from your Arduino sketch

(Message logger visualizer only)

Commands sent by your Arduino program to a message logger visualizer can control logging. Your Arduino program can start and stop logging if the Allow serial commands to start and stop logging is checked using the StartLogging and StopLogging commands. If Allow serial commands to set filename is checked your Arduino program can change the filename of the log file using LogTo.

Note: commands only apply to the Message Logger visualizer, not to the Log to File visualizer.

Leave a Comment

Start typing and press Enter to search