问题
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