Refactor log message in Agent class