[Git][ghc/ghc][master] Avoid expensive computation for debug logging in `mergeDatabases` when log level is low