if os.path.exists(tmplogfile) and not os.access(tmplogfile,os.W_OK):
loggername = loggername + "-console"
handler = logging.StreamHandler()
if os.path.exists(tmplogfile) and not os.access(tmplogfile,os.W_OK):
loggername = loggername + "-console"
handler = logging.StreamHandler()