Kinda verbose, ain't it? Just speaking from my own personal experience, usually when I resort to print-debugging I'm already pretty punchy and more likely to use a quick "ASDFASD" or similar.
Kinda verbose, ain't it? Just speaking from my own personal experience, usually when I resort to print-debugging I'm already pretty punchy and more likely to use a quick "ASDFASD" or similar.
This solves many of the concerns raised in this thread about readability, automation, avoiding typos in the magic string.
The tricky thing you have to solve is how to push the code that defines the custom logging function, but there are solutions.
I occasionally need to override the hook, for example when using mktemp -t, or when some floating-point data actually contains a run of 9s. But mostly, it is quite specific at catching stuff that shouldn't be checked in.
> Kinda verbose, ain't it?
I always used the word "doberman" for this purpose. I've never written code for a project that legitimately included the name of a dog variety. A simple grep for "doberman" in the production release CI pipeline catches it. If one ever did slip thru I figured it wouldn't be too offensive to anybody.
You can't automate checking for random strings, right?
You won't need to submit that particular string working at Google, right?
Confused sysadmins wondering if this is SOX code...
Seems easy enough?
No, but you can make the string configurable.
- Nothing happens
- Easy to find string in code, output, wherever