简体   繁体   中英

log message in gradle build doesn't show in gradle console of Android Studio

My build.gradle would like to log messages, I tried:

signingConfigs {
        debug {
            ...

        }

        release {
           ...
           project.logger.info("I am releasing build!");
        }
    }

buildTypes {
        debug {
            ...
        }
        release {
          signingConfig signingConfigs.release
          project.logger.info("I am releasing build too!");
        }
 }

I choose "release" from build variant. But when I run build, I can't find the log message from "Gradle Console" on the right-bottom of Android Studio. Why? (I am using Android Studio 3.0.1)

在此处输入图片说明

You are logging with info level. To show info messages you have to run your tasks with --info or lower flag.

To print your message without any additional flag you should use lifecycle logging level eg project.logger.lifecycle('I am releasing build too!') or just print to System.out println('I am releasing build too!')

You may read more about logging at gradle tasks here https://docs.gradle.org/current/userguide/logging.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM