Hi I want to see what is being passed to a rule that is defined in a rules.bzl file. So I would like to add just a logging statement inside of either the BUILD file or the rules.bzl file just to see what parameter was passed. I realize there is a whole --execution_log_binary_file and there is a good deal of stuff to read up on, but I am definitely looking to do something just once and quick and dirty. Do I import logging module? Is it something else? Thanks
bazel logging inside of a BUILD file
5.4k Views Asked by uh_big_mike_boi At
2
There are 2 best solutions below
0
On
bazel query --output=build //my/package:all will print out the definitions of all the targets created by macros called from my/package/BUILD by any .bzl file. This includes all the attributes passed to to various rules to create those targets.
Use the builtin Starlark
print()function inBUILDor.bzlfiles to dump values Bazel's console.