Update agent.py

updated record_log_activity()