Well if $mode is not one of phpbb's default modes (critical, user, admin, mod), no log_type is set and the entry will not be added.