by bb101 · 11y ago · 0 comments
For example, converting a user input to an integer. You can provide safe defaults if the value doesn't convert so it doesn't break the flow. As the developer however, if you see too many warnings with conversion errors then you may want to change the label of the form field, or provide some guidance to make it more clear to the user.
For example, the user has provided a config with two TCP ports to listen to, but the program only supports one.
You can either error out, and abort the action to listen to a port, or warn the user saying that you chose one of the ports, and proceed with listening to a port.
For a similar example: The D compiler gives very few warnings and some people want to remove those as well. The argument is that the compiler should not do the job of static analysis tools, just because it is convenient or easy. A compiler should either generate code or give an error.
If something is for developers only, make it debug-level.
However, in the server environment, there is also the IT/sysadmin role between user and developer. It makes sense to provide a level specifically for them. "warning" mostly fits that.
So say you're doing an hourly sync, and it falls over, you want to log a warning. It happens, no need to send out the fire engines.
If you're getting a warning every hour, that's "too many warnings".
postfix/postdrop[21416]: warning: mail_queue_enter: create file maildrop/465240.21416: No space left on device
My question is, if that is a warning, what's an error?