Add a log when entering/leaving a state