added to log file usage: check wether logging to file, close an existing log file if a new file is requested