Modify log_input: save only one message for each branch