python logger flush stdout