Skip to content

Commit

Permalink
fix(android): Move noisy debug logging out of "quiet" log level. (#844)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gnprice authored and Titozzz committed Sep 4, 2019
1 parent f24805d commit b2cd6b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions android/build.gradle
Expand Up @@ -72,7 +72,7 @@ repositories {
name androidSourcesName
}

logger.quiet(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
found = true
} else {
def parentDir = rootProject.projectDir
Expand All @@ -97,15 +97,15 @@ repositories {
name androidSourcesName
}

logger.quiet(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
found = true
} else if (androidSourcesDir.exists()) {
maven {
url androidSourcesDir.toString()
name androidSourcesName
}

logger.quiet(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
found = true
}
})
Expand Down

0 comments on commit b2cd6b5

Please sign in to comment.