Writing the command in the log before doing it