更新时间:2023-02-16 18:07:22
我假设您想将Gradle的日志记录系统用于Gradle插件的日志输出?
I assume you would like to use Gradle’s logging system for your log output from a Gradle plugin?
在那种情况下,我建议以不同的方式创建/获取记录器实例.使用project.logger.info(…)
或
In that case I would suggest to create/get the logger instance differently. Either use project.logger.info(…)
or create a new Logger
like so:
private static final Logger logger = Logging.getLogger(ConfigurationPluginInitBase.class)
话虽如此,您的日志消息当前可能不显示的原因可能是Gradle的默认日志级别为LIFECYCLE
–但是您似乎只登录了INFO
.您可以尝试使用--info
选项运行Gradle来查看消息.
Having said that, the reason why your log messages might not show up currently could be that Gradle’s default log level is LIFECYCLE
– but you seem to only be logging to INFO
. You can try running Gradle with the --info
option to see your messages.