Update console.py

fix NameError: global name 'log_both' is not defined