Add logging support to close #1