1
Fork 0
treehouse/content/programming/opinions/tracing.tree

28 lines
1.2 KiB
Text

%% title = "tracing is better than logging"
% id = "01HBTSXTTA08SCA313HSFWB13T"
- information about time spans is very valuable for profiling
% id = "01HBTSXTTAAHQ0Q8GY78Z1RYFN"
- and you do not have to worry about "should I log before I start the operation, or after I end the operation?"
% id = "01HBTSXTTAJ6R319P2N6HT54CA"
+ additionally, traces made of spans are way easier to visualize than tonnes of logs
% id = "01HBTSXTTA3M93STVPHA898GM4"
- if you've never tried [Perfetto](https://ui.perfetto.dev/) or similar tools, I highly recommend giving it a shot
% id = "01HBTSXTTAB9WD17FNDE5RYP8Y"
+ I also imagine visualizing traces live in your CLI could yield a very nice user experience,
with a visible progress indicator as to what eg. [your compiler][branch:programming/projects/muscript]
is working on right now at a glance, reassuring you that it is not stuck on some
`while (true) {}` in constant evaluation
% id = "01HBTSXTTA3Q36Y98GSBRVCS3B"
- perhaps emitting warnings along the road for things that take alarmingly long, so that you
can keep your build times in check
% id = "01HBTSXTTAA89CXD17GBNR3FEQ"
- though printing to stdout is quite slow, so perhaps limiting the frequency or depth would
be a worthwhile thing to do