to add functionality to debug code for writting the debug messages to a file instead of the terminal for running in NRT