FTC Creating Log Files 202008

From wikidb
Jump to: navigation, search

Existing Log Files


On Comput Platform

On Drivers Station

maybe this was on the controller hub with a keyboard plugged in

  • ... -> File Manager app -> Documents -> driverStationLog.txt
  • saw a log on the driver station
  • File Manager app
    • Documents
      • driverStationLog.txt

Using

 adb shell date
     Thu Aug 6 15:50:46 PDT 2020

Create Log Files

TBD: add comments to above

     To remove a null pointer exception the follow modifications were made.
     See the following added around line 9
       import java.lang.String;

     See the following added around line 30
       line = new String("");

Date info

TBD: Move this to performance maasurement

  • System e.g. nanotime currentTimeMillis

Time Format References

Effective for creating file names

Example Code

 import java.text.SimpleDateFormat;  
 import java.util.Date;  
 public class SimpleDateFormatExample {  
 public static void main(String[] args) {  
     Date date = new Date();  
     SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");  
     String strDate= formatter.format(date);  
     System.out.println(strDate);  
   }  
 }

Open AppData directory

Windows
Live files are usually stored in two locations, the Roaming and Local folders contained within the AppData folder (Users\[your username]\AppData\)

To open the AppData folder on Windows 10, 8 & 7:

Open File Explorer/Windows Explorer
Type %AppData% into the address bar and hit enter
Navigate to the required folder (Roaming or Local)


To permanently display all hidden folders on Windows 10 & 8:

Open File Explorer/Windows Explorer
Click View then select Options

In the Folder Options window, choose View, select Show hidden files, folders, and drives, and then click OK