sfackler / rust-log-panics

Apache License 2.0
54 stars 15 forks source link

Log addresses when using Unresolved backtrace mode #12

Open kathoum opened 1 year ago

kathoum commented 1 year ago

With the current version, when I configure panic logging with BacktraceMode::Unresolved, the message doesn't contain function addresses but just <unknown> (tried on linux-gnu, windows-msvc and macos).

In order to include addresses in the backtrace, it's necessary to format the Backtrace object using the alternate debug form ({:#?} instead of {:?}). If I do, the output changes from

   0: <unknown>
   1: <unknown>
   2: <unknown>

to

   0:        0x102dbfde7 - <unknown>
   1:        0x102dbfd82 - <unknown>
   2:        0x102dc488b - <unknown>

I'm using the following crate versions: