Search code examples
javabazel

Is there verbose logging for Bazel?


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?


Solution

  • To debug what Bazel does and why:

    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