Update data_logging.py

Limiting sys.stdout redirection for Production mode only.