Fix logging in 'agent' module