Is there verbose logging for Bazel?

╄→гoц情女王★ 提交于 2019-12-10 21:39:51

问题


I dig around Bazel source code, there aren't much logging it seems. Is there a way to enable some kind of verbose mode so I can see what bazel is doing?

Also there seems to be various kind of debug options but I cant seem to comprehend yet, if I want to debug say java_library how should I do it?


回答1:


To debug what Bazel does and why:

  • To list the commands Bazel executes, use the "--[no]subcommands" flag.
  • To request listing just the failing commands, use the "--[no]verbose_failures" flag.
  • To request writing an explanation of the build, use the "--explain" flag. Use "--[no]verbose_explanations" to adjust verbosity.

To debug programs you built with Bazel:

  • You cannot debug java_library rules
  • You can debug java_binary rules. Build with "-c dbg" (see the "--compilation_mode" flag), then run the binary with bazel-bin/path/to/java/program --debug=<port>

EDIT: added info about --verbose_failures and --verbose_explanations



来源:https://stackoverflow.com/questions/52722448/is-there-verbose-logging-for-bazel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!