nskinkel/oppy — pull request #77 by nskinkel (2014-12-20 04:47:33+00:00)
Title: Logging

This branch upgrades `oppy`'s logging functionality.

Major changes:
- use Python's standard library `logging` module (to avoid noisy `Twisted` logs writing IP addresses and factory start times all over the place)
- log "lifetime events" in `DEBUG` mode, log a conservative set of important events otherwise
- implement a simple command line interface with the following options:
- log-level (defaults to INFO)
- log-file (defaults to stdout)
- socks-port (defaults to 9050)

These options can be seed by running `oppy --h` or `oppy --help`.

In the future it might be worth using a `Twisted` `PythonLogObserver` and just writing a custom filter to remove things we don't want, but I think using `logging` is good enough for now.

Note that as I was going through each file I also removed some old and unused code.