If I'm writing a script or a program, should I output to stderr its name together with warning or error message? For example:
./script.sh: Warning! Variable "var" lowered down to 10.
./prog.py: Error! No such file: "file.cfg".
I understand that generally it is just a matter of taste (especially if you write your own stuff for yourself), but I wonder if there's anything conventional to that? I believe most UNIX/Linux utilities write their names when something happens, so it seems to be a good thing, but are there any guidelines or unspoken rules how to do that and how not to?
For example, it's not advisable to install binaries under
/usr/bin/, rather under
/usr/local/bin/ or something else. Are there similar rules about output to stderr? Should I write the name followed by a colon? Or just "Warning!" and "Error!" words? I couldn't find anything but maybe someone could point me to where to read about it.
This question is a bit about programming practices, but I thought it is more appropriate here rather than on stackoverflow, as it's about UNIX/Linux traditions and not programming in general.