@log
def reset_logpath(logpath):
 global logger
 if (not logpath):
  return
 if os.path.isfile(def_logpath):
  if (os.path.getsize(def_logpath) == 0):
   os.remove(def_logpath)
 handlers = logger.handlers
 for handler in handlers:
  logger.removeHandler(handler)
 handler = logging.FileHandler(logpath)
 handler.setFormatter(formatter)
 logger.addHandler(handler)

@ log def reset_logpath ( logpath ) : global logger if ( not logpath ) : return if os . path . isfile ( def_logpath ) : if ( os . path . getsize ( def_logpath ) == 0 ) : os . remove ( def_logpath ) handlers = logger . handlers for handler in handlers : logger . removeHandler ( handler ) handler = logging . FileHandler ( logpath ) handler . setFormatter ( formatter ) logger . addHandler ( handler )
reset logpath to path from command line .