Add log functionality