def main56(): # logging.config.fileConfig('logging.conf') logging.basicConfig(level=logging.DEBUG) log = logging.getLogger('main') admin = Admin() for i in range(1000005, 1000008): try: admin.create_user(str(i)) except RequestFailedError: logging.info(u'Create user %d - RequestFailedError\n' % i) continue
def __call__(self): # for 10 threads logWrapper("TestScript1") admin = Admin() try: for i in range(0, 100000): id = i + (self.tid-1) * 100000 admin.create_user(str(id)) except RequestFailedError: logWrapper(u'Create user %d - RequestFailedError\n' % id) logging.warn((u'Create user %d - RequestFailedError\n' % id))