DateLog - ParlocameonTheDev/Parlocameon.Generic.Logger-Loggy GitHub Wiki

Description

Commonly used by me to start and declare log files, it comes with an autocomplete feature for logs, set to false by default, it will create a file to the specified folder path, like


Example Path: C:\Users\user\appdatamysoftware
WHAT NOT TO DO:

  • C:\Users\user\appdatamysoftware
  • C:\Users\user\appdatamysoftware\file.log - if using autocomplete, this will be file.logdate.log! Otherwise, it SHOULD be fine if you define filename as null. Don't leave an open path, especially if using autocomplete!!!

Example

Finally, an example of it being used.

//params
DateLog(String dirpath, String filename, Boolean autoComplete=false);

Autocomplete:

String appDataLocalPath = Logspace.appDataLocalPath;
String dirpath = appDataLocalPath + @"\myprogram\";

//returns full path, including generated file since autoComplete is set to true, otherwise null
String path = DateLog(dirpath, null, true);

Without autocomplete:

String appDataLocalPath = Logspace.appDataLocalPath;
String dirpath = appDataLocalPath + @"\myprogram\";

String path = DateLog(dirpath, "mylog.log", false);
//OR:
String path = DateLog(dirpath+@"\mylog.log", null, false);