how do I dump log lines in real-time during a Pant...
# development
f
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
have you decorated your test case with the
rule_runner.logging
decorator?
f
have you decorated your test case with the
rule_runner.logging
decorator?
yes
c
ok, then Iโ€™m out of ideas ๐Ÿ˜›
f
and
RuleRunner
was passed a
-ldebug
option to
set_options
c
๐Ÿค”
f
the log lines are all
println!
in Rust and
print
in Python
unclear to me why none of them trigger
c
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
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
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
happy it worked ๐Ÿ˜„