check_log_mode function

Check if the supplied mode is a valid logging mode.