4 ms·
One of the best things I did as one of the earliest employees at $company was helpers to setup Python logging and command line argument passing, so -v/-q flags
by stubish 2y ago
One of the best things I did as one of the earliest employees at $company was helpers to setup Python logging and command line argument passing, so -v/-q flags controlled what level got emitted to STDERR, and other CLI flags configured where and what level logs got emitted. You didn't use print, just logged messages. Devs could stick in their informative messages at INFO, warnings, errors, critical errors at levels, debugging and tracing right down to DEBUG2 level, and ops could actually control how things worked in the software they needed to deploy. Consistently, without worrying about each and every special snowflake (at least as far as the inhouse Python was concerned). Timestamps even on INFO turns out to be really useful. Weird problem? Devs could get ops to crank up the logging on staging or production to help diagnose the problem. Everybody used it without being pushed, for at least 16 years (and is still preferred use AFAIK).