Merge "Record the trimmed cmd string for logs"