Add more info to log statements and adjust docstring.