I can do
$./a.out 1>stdout_file 2>stderr_file
But then i dont see anything on the screen. Or I can do
$./a.out | tee log.log
But then stdout and stderr goes to the same file.
How can I achieve both?
Does this work for you? (I assume you're using bash as you're on Linux, not sure about other shells):
./a.out 1> >(tee stdout.log) 2> >(tee stderr.log)