I’m working with the output of a program to which I have the C++ source code. The program sends output to stderr, and I need to know where/how the output is calculated in the source code.
I know that one form to send something to stderr is
std::cerr << "foo";
I use grep to see if this form is used, but I can’t find it.
I know that is written to stderr because when I run the program I obtain the output in this form:
./program 2> file-with-info.txt
Are there any other ways for output to be sent to stderr? Can anybody suggest patterns I might grep for to find where this output is being sent?
It’s not
but
You can try to grep for clog (redirected to the standard error stream) too :
You can also search for stderr and perror which are the old C ways to output to standard err