Hi! Possibly stupid question: how do I get output from
dbg! invocations within rustdoc?
I got it to work, but it's a bit unpleasant. I have to manually specify the library paths at the moment.
Ahh, figured it out.
Sorry to bother y'all!
inquisitivecrystal has marked this topic as resolved.
By the way, what was the solution you came up with? I've never managed to get
dbg! to work within rustdoc—I always use
debug! (which is a logging macro I think provided by
That's really strange, dbg should work fine
Hmm, maybe my config.toml is configured such that the output is being swallowed or something...
There should be no possible way to configure that. Dbg writes directly to stderr.
dbg! only works on debug builds, maybe you're building in release mode?
@GuillaumeGomez that is not the case, it works unconditionally
I never saw a
dbg! statement when I debugged rustdoc :-/
You're thinking of debug! which is controlled by
debug-logging and off by default in release mode
@GuillaumeGomez yes, because they get removed before merging because they log unconditionally
no I meant when I added myself for tests
Maybe it's worth checking if I didn't change the local config somehow for rustdoc...
Are you sure the test suite wasn't just hiding the output? dbg! goes through the exact same output as eprintln!
@GuillaumeGomez my whole point is that hiding the output through config.toml shouldn't be possible
Hum, that might be it. And I was simply thinking that they maybe updated their
I just tested it, and
dbg! does work for me! I'm not sure why it hadn't worked before, but I'm glad it does now.
I'm sorry, I wish I saw this sooner. The problem I had is that it seems that rustdoc won't rerun if you add a
dbg! somewhere, so I had to clean the old doc build to get rustdoc to rerun. Otherwise, it seemed like it was just giving me cached output from a previous run. I don't know if that was the actual problem, but cleaning the old docs seemed like it fixed it.
I could just be totally wrong though.
That seems possible. I try to avoid cargo altogether when modifying rustdoc, I find it pretty hard to predict when it will rerun the binary
Especially since it doesn't notice when the binary changes on disk
Last updated: Oct 11 2021 at 22:34 UTC