Functionality to log and write to a file

Initial version of the code that logs to a file as well as can write
some data to an existing file