added definitions to allow optional (commented out) logging to file as well as console