Update documentation.

Add docstring for logOnException().
Add tests for logOnException().