Garmin Log File Creator

This little Windows BAT file has been useful for me. It automatically clears your LOG files and recreates empty TXT files for each of your CIQ apps. To capture log writes.

Several of my data fields write useful activity insights to LOG files that I can view after an activity. Also useful if you've added diag logic to an app.

NOTE: writing to LOG files is expensive, so I only write to a LOG file occasionally when something "interesting" happens. Also, this creates LOG files for all your CIQ apps, so there is always a chance that an app from someone else might write to a log file very frequently and slow down your device. I've never seen this happen, but it could. You can tell if that is happening if the Backup Log File is created... meaning the app has written often enough to overrun the LOG file's size threshold.

Anyway, this is just a convenient way to generate LOG files without having to manually check the cryptic file names of your PRG files and create the associated LOG files.

I store this on my EDGE device and double-click on the BAT file to run it.

============================

REM This batch file clears and creates LOG files in a Garmin Device
REM These capture System.print() lines from CIQ applications
REM Place this BATCH file in the device's GARMIN folder (eg: D:\Garmin)
REM Run this by double clicking on the file from Window's File Explorer

@echo off
setlocal

REM remove all the CIQ LOG files (.TXT files)
del /f /q .\APPS\LOGS\*.* 2> NUL

REM list out all the PRG files on the device
REM for /f %%f in ('dir /b /S *.PRG') do echo %%f

REM for each PRG file in MEDIA, create a log file
for /f %%f in ('dir /b /S *.PRG') do type NUL > .\APPS\LOGS\%%~nf.TXT

REM list out all the LOG files
dir .\APPS\LOGS

echo Press any key to exit . . .
pause>nul

endlocal