In Gradle, how to print out a message in the console / Event Log?

后端 未结 3 1239
难免孤独
难免孤独 2021-02-02 05:15

I\'m trying to verify that my source and target paths are properly setup when I execute a deploy command.

See the example below:
(copied from: http://eppz.eu/blog/u

3条回答
  •  春和景丽
    2021-02-02 05:58

    Gradle utilizes a logging framework. You can log messages to that. By default, only log level lifecycle and above are shown, but you can log at other levels such as debug and info.

    To log at debug level (visible with builds using gradle --debug or lower)

    project.logger.debug('my debug message')
    

    To log at info level (visible with gradle --info builds and lower)

    project.logger.info('my info message')
    

    To log at lifecycle level (visible by default)

    project.logger.lifecycle('my message visible by default')
    

提交回复
热议问题