I think we could actually do this at the bottom of fileLocations.php.  So, we have one block of lines do set the file name, like 

$statusEndFileName = 'Status_End';

and then in a block below it we can calculate complete names, like 

$statusEndComplete = $up.$dataF.$subFolder.$statusEndFileName.$outExt;

Also, rather than having a session variable handle the debug/nondebug subfolder, we could have the variable $subFolder default as the nondebug folder, and then the initiateCollector() function could access this as a global variable, check if debug mode is on, and change $subfolder to $debugF if appropriate.

Then, every recording would just be done with something like 

$data = [username + id + post]
arrayToLine( $data, $statusEndComplete );