This log_debug is redundant with the two log_debug and one log_error statements inside the switch().  I recommend removing it.