Also, make the function that implements LOG_PROTOCOL_WARN use a cached value of the desired loglevel, rather than calling get_options().