How to flush Python logger

The StreamHandler class has a flush method. Call it!

If you’re using a wrapper containing a StreamHandler, provide a
flush method in the wrapper which calls the inner flush method.