3 ms·
The idea for info is that it's informational, which is always the case regardless of whether it's printing error messages due to a failure or informational mess
by packetlost 2y ago
The idea for info is that it's informational, which is always the case regardless of whether it's printing error messages due to a failure or informational messages because the user specified a `-v` flag or whatever. Whether the command failed or not is communicated via the exit code. That being said, I do prefer stdlog for the reasons: it communicates the intent and usage as unambiguously and tersely as possible.
- matheusmoreira 2y ago> because the user specified a `-v` flag or whatever The way I see it is the version information and help text belong on standard output if the user passes --version and --help since that's what the user explicitly asked for. When the command is invoked incorrectly, the help text should go to standard error while standard output should be empty. I agree about the exit code. People like to parse error messages and that's always wrong. Everything should be done via exit codes instead.
- packetlost 2y agoThe `-v` was in reference to the common convention of one or more `v` flags increasing the verbosity of logging.