2 ms·
Format strings are very useful, so I'd suggest fixing the language to let you use them. You don't have to live with it interpreting them too early! Even better
by astrange 1y ago
Format strings are very useful, so I'd suggest fixing the language to let you use them. You don't have to live with it interpreting them too early!
Even better, you should be interpreting them at time of reading the log, not when writing it. Makes them a lot smaller.
- WD-42 1y agoThe thing is, the logging calls already accept variable arguments that do pretty much what people use f-string in logging calls for already, except better. People see f-string, they like f-string, and they end up in logs, that's really all there is to it.
- yuliyp 1y ago> you should be interpreting them at time of reading the log This reminds me of a fun interaction in browser devtools: you can log a complex struct to the console. The browser does not copy the entire nested structure when you do so immediately, meaning that if someone mutates that struct after it was logged, the value you see depends on when you expanded the nested struct.
- deleted 1y ago[deleted]