Should GUI application guides send to std :: cerr?

Should a Unix GUI application warning be sent to std :: cerr or std :: cout?

This assumes that the GUI typically presents warnings and errors in the console window and also sends them to the log file. But in the event that the console is absent and therefore cannot be used, should std :: cerr, std :: cout or std :: clog be used for such messages?

I think std :: cerr is where they belong.

+3
source share
4 answers

For the compiler, error messages for compiled code are “normal” outputs, so they should be written to stdout, not to stderr. The only messages that need to be written to stderr will be errors when starting the compiler itself (for example, if the file that is part of the compiler cannot be found, so the compiler could not start).

: "" "" , , , / , . , / , , - , , , , , .

+1

cerr. , cerr

tool 2>/dev/null >output

SOL.

cerr , , . , /dev/null - ... , .

+6

, , std::cerr.

+4

Windows std:: cerr, std:: cout GUI, . , nix.

+1

Source: https://habr.com/ru/post/1768106/


All Articles