Add logging ability (unfinished).