Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python.announce > #1808
| Date | 2015-08-10 14:57 -0400 |
|---|---|
| Subject | ANN: Eliot 0.8, the logging system with causality |
| From | Itamar Turner-Trauring <itamar@clusterhq.com> |
| Newsgroups | comp.lang.python.announce |
| Message-ID | <mailman.68.1439287698.3627.python-announce-list@python.org> (permalink) |
Most logging systems can tell you what happened; Eliot tells you *why* it
happened:
$ python linkcheck.py | eliot-tree
4c42a789-76f5-4f0b-b154-3dd0e3041445
+-- check_links@1/started
`-- urls: [u'http://google.com', u'http://nosuchurl']
+-- download@2,1/started
`-- url: http://google.com
+-- download@2,2/succeeded
+-- download@3,1/started
`-- url: http://nosuchurl
+-- download@3,2/failed
|-- exception: requests.exceptions.ConnectionError
|-- reason: ('Conn aborted', gaierror(-2, 'Name unknown'))
+-- check_links@4/failed
|-- exception: exceptions.ValueError
|-- reason: ('Conn aborted.', gaierror(-2, 'Name unknown'))
And here's the code that generated these logs (eliot-tree
<https://warehouse.python.org/project/eliot-tree/> was used to render the
output):
import sys
from eliot import start_action, to_file
import requests
to_file(sys.stdout)
def check_links(urls):
with start_action(action_type="check_links", urls=urls):
for url in urls:
try:
with start_action(action_type="download", url=url):
response = requests.get(url)
response.raise_for_status()
except Exception as e:
raise ValueError(str(e))
check_links(["http://google.com"], ["http://nosuchurl"])
Interested? Read more at https://eliot.readthedocs.org/.
Eliot is released under the Apache License 2 by ClusterHQ
<https://clusterhq.com>, the Container Data People. We're hiring!
<https://clusterhq.com/careers/>
Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread
ANN: Eliot 0.8, the logging system with causality Itamar Turner-Trauring <itamar@clusterhq.com> - 2015-08-10 14:57 -0400
csiph-web