goblint / analyzer

Static analysis framework for C
https://goblint.in.tum.de
MIT License
160 stars 72 forks source link

Automatically add newline to trace output #1393

Closed sim642 closed 3 months ago

sim642 commented 3 months ago

It has always been annoying that every trace call must include a trailing newline in its format string. Otherwise trace output becomes unusable because multiple steps are printed on the same line. We can just have the tracing module itself add the newline, just like how it adds the %%% prefix with indentation.

While adapting all trace calls, I found a couple in central parts of base analysis which weren't guarded by if M.tracing then.

TODO

sim642 commented 3 months ago

As for all the \n\n-s, I see no reason to have tons of double empty lines in already-way-too-long tracing output. Large printed abstract values are printed indented after their %%% line and end where the next %%% appears for the following tracing at the beginning of the line. So they're already delimited by the %%% lines and the two empty lines just mean more scrolling.

Also, empty lines can be annoying/misleading because often tracing output has values with massive (500+) levels of indentation, so it's not obvious whether it's empty or there's something off-screen far right, without carefully scrolling horizontally. The %%% are at the beginnings of separating lines, so you can already tell where one large value ends just by the beginning of the line.

michael-schwarz commented 3 months ago

Once the two comments above are resolved, I am happy to approve!