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.3k views Asked by uh_big_mike_boi At
2
There are 2 answers
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 inBUILD
or.bzl
files to dump values Bazel's console.