Writing python to stdout in git bash

I have a logged python script that prints to stdout

logger = logging.getLogger()
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(v_level)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)

      

It works fine when I run my script in my Linux box, but when I run the script in git - bash on Windows, there is no output in the console.

Any thoughts?

+1


source to share


1 answer


Going through the information in this question , it looks like it might be an output buffering issue. You can skip buffering by running your script with python -u

.



0


source







All Articles