Refactor logging

This commit resolves the outstanding issues #242 and #243.
I strayed a little from the proposed solution in order to improve the possibilities of the API and leverage the control provided by the logging package.