Escalate the "analysis cache discarded" message from "info" to "warn", and add some text to advise that discarding the analysis cache may be expensive.

PiperOrigin-RevId: 524409797
Change-Id: Iabafdd62e66d7be57fc6383d8af9c2ef3d707fc0
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
index 52e0a6a..74272b1 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
@@ -273,14 +273,15 @@
       EventHandler eventHandler, BuildConfigurationValue configuration, int maxDifferencesToShow) {
     if (skyframeAnalysisWasDiscarded) {
       eventHandler.handle(
-          Event.info(
+          Event.warn(
               "--discard_analysis_cache was used in the previous build, "
                   + "discarding analysis cache."));
       skyframeExecutor.handleAnalysisInvalidatingChange();
     } else {
       String diff = describeConfigurationDifference(configuration, maxDifferencesToShow);
       if (diff != null) {
-        eventHandler.handle(Event.info(diff + ", discarding analysis cache."));
+        eventHandler.handle(
+            Event.warn(diff + ", discarding analysis cache (this can be expensive)."));
         // Note that clearing the analysis cache is currently required for correctness. It is also
         // helpful to save memory.
         //