fix false positive in check loaded

only check loaded modules when the log level ensures that we have this
information.