Added writeToLog method

Pass a log string into the method to write it to the appropriate log
file