Replace print calls with logging
Replace print calls with logging: a task in vim-headless-mastery: vim (Harbor dataset). def upload(batch, url): print("uploading %d samples" % len(batch)) for attempt in range(3): try: requests.post(url, json=batch, timeout=10).raise for status() print("upload ok") return True except…
The task
def upload(batch, url): print("uploading %d samples" % len(batch)) for attempt in range(3): try: requests.post(url, json=batch, timeout=10).raise_for_status() print("upload ok") return True except requests.RequestException as exc: print("upload failed: %s" % exc, file=sys.stderr) time.sleep(2 ** attempt) print("will…
Part of swedishembedded/vim-headless-mastery.