3 ms·
STDOUT is for data, STDERR is for commentary. If your program is a server, then its logs are data, not commentary. I’d have them on STDOUT so I can `myServer |
by jitl 3y ago
STDOUT is for data, STDERR is for commentary. If your program is a server, then its logs are data, not commentary. I’d have them on STDOUT so I can `myServer | grep myBug`.
If your program is a data processing tool, then you should avoid printing any logs ideally, and those go to STDERR. A misplaced log on STDOUT will break readers who expect you to be writing JSON or another well specified format on STDOUT.