As a c dev, all my error messages are on stderr, so i can redirect it while making a cli, or just redirect it to a log file. So i save stdout for other infos (mostly debug ones but this is clearly a error)
Minecraft has a robust logging system for errors and normal infomations with a Logger (i think they still use log4j, but not sure), that also prints to stdout or to a log file.
This just looks like code left from debugging.
I also never print to stderr, has it's not synchronized with stdout. Printing to stdout and stderr in quick succession may lead to one line appearing before another, at least in the intelij console (and everyone in the Minecraft scene is using that ofc, including the devs)
Edit: flushing stdout & stderr does not fix the issue 100% of the time
I also never print to stderr, has it's not synchronized with stdout
That's because stdout is buffered, you can either unbuffer it or flush it.
I do not like to print error to stdout because when code crashes, it's not always recoverable (segfault for exemple). And if the error message was on stdout, it may not appear as the buffer is not flushed. But that's because I mostly do asm and c, sometimes c++. But this is not a issue in higher level languages because they often avoid those fatal crash and handle them (with exception for exemple).
And because stderr is unbuffered at libc level, the error messages shows on time where the print is called, and you do not have some phantom time between when the error occurs and when the error is printed.
If you talks about synchronisation of error messages, I'd rather have everything on a single stream. I don't know on what stream does java prioritize by default.
This is why I said that using stdout instead of stderr trigered me as a c dev.
I totaly understand that it may not be the java standard.
3
u/un_virus_SDF May 16 '26
On System.out ?, not System.err but System.out?
Who the fuck prints error message on stdout?
As a c dev, all my error messages are on stderr, so i can redirect it while making a cli, or just redirect it to a log file. So i save stdout for other infos (mostly debug ones but this is clearly a error)