Add q3py logging functions

Add q3py_log() and q3py_error() functions in preparation for issue #9