瀏覽代碼

fix(android): Move noisy debug logging out of "quiet" log level. (#844)

Each time building our app, this library causes a message like this
one to be printed, sometimes twice:

  > Configure project :react-native-webview
  :react-native-webview:reactNativeAndroidRoot /home/greg/z/mobile/node_modules/react-native/android

Worse, the message comes through even if I silence all normal
progress messages and warnings, with `./gradlew --quiet`.

It turns out that the `logger.quiet` method which these log lines are
using has a confusing name.  It doesn't mean "log quietly", but more
like the opposite: "log even when asked to keep things quiet".  See
documentation on Gradle log levels:
  https://docs.gradle.org/current/userguide/logging.html

So, remove the noise by switching to `logger.info`.  This avoids
bothering the user by default, and keeps the information readily
available if desired by passing `--info` to Gradle.
Greg Price 5 年之前
父節點
當前提交
b2cd6b54fa
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      android/build.gradle

+ 3
- 3
android/build.gradle 查看文件

@@ -72,7 +72,7 @@ repositories {
72 72
       name androidSourcesName
73 73
     }
74 74
 
75
-    logger.quiet(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
75
+    logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
76 76
     found = true
77 77
   } else {
78 78
     def parentDir = rootProject.projectDir
@@ -97,7 +97,7 @@ repositories {
97 97
           name androidSourcesName
98 98
         }
99 99
 
100
-        logger.quiet(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
100
+        logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
101 101
         found = true
102 102
       } else if (androidSourcesDir.exists()) {
103 103
         maven {
@@ -105,7 +105,7 @@ repositories {
105 105
           name androidSourcesName
106 106
         }
107 107
 
108
-        logger.quiet(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
108
+        logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
109 109
         found = true
110 110
       }
111 111
     })