https://pantsbuild.org/ logo
#development
Title
# development
f

fast-nail-55400

10/03/2022, 6:36 PM
how do I dump log lines in real-time during a Pants test when testing an intrinsic? I am running
./pants test --debug path/to/test.py -- -vv --full-trace
but none of the print statements in either my test or the intrinsic in Rust are being displayed.
just hangs like this:
Copy code
% ./pants test --debug src/python/pants/engine/internals/docker_test.py -- -vv --full-trace
========================================== test session starts ===========================================
collected 1 item

src/python/pants/engine/internals/docker_test.py::test_resolve_image_id
ctrl-c'ing out of the test shows
src/python/pants/engine/internals/scheduler.py:520
as the last point in Python stack
c

curved-television-6568

10/03/2022, 6:38 PM
have you decorated your test case with the
rule_runner.logging
decorator?
f

fast-nail-55400

10/03/2022, 6:38 PM
have you decorated your test case with the
rule_runner.logging
decorator?
yes
c

curved-television-6568

10/03/2022, 6:38 PM
ok, then Iโ€™m out of ideas ๐Ÿ˜›
f

fast-nail-55400

10/03/2022, 6:38 PM
and
RuleRunner
was passed a
-ldebug
option to
set_options
c

curved-television-6568

10/03/2022, 6:39 PM
๐Ÿค”
f

fast-nail-55400

10/03/2022, 6:39 PM
the log lines are all
println!
in Rust and
print
in Python
unclear to me why none of them trigger
c

curved-television-6568

10/03/2022, 6:40 PM
in python, perhaps they get eaten, worth writing to a fixed file instead, just to get going? (or add a
breakpoint()
just to get into stuff)
w

witty-crayon-22786

10/03/2022, 6:41 PM
do
log::info!
messages get captured from rust? i canโ€™t remember whether the
@logging
decorator would care about the difference between logging and writing directly to stdio
f

fast-nail-55400

10/03/2022, 6:41 PM
breakpoint
in Python at least gets me into the test
much better, Rust is pancing
and the engine is looping, hitting the panic in the intrinsic over and over
but no output until I went into the Python side with the debugger
ok problem fixed once I found the issue with decoding a field in the intrinsic. the panic loop seems problematic.
@curved-television-6568: thanks for the
breakpoint
idea!
๐Ÿ™ 1
c

curved-television-6568

10/03/2022, 7:04 PM
happy it worked ๐Ÿ˜„