So I know that logging compilation errors can be done as follows in the terminal
gcc -o objectname filename.c 2>'compilation_error_log.txt'
I get some memory error while executing the code and want to log that as well. I tried the same approach
./objectname 2>'Execution_error_log.txt'
but it's not working. Can someone tell me where the memory errors get stored so I can log them? My error and output looks somewhat like this
./objectname arg
Expected Output.
*** Error in `./objectname': double free or corruption (!prev): 0x089d1008 ***
Aborted (core dumped)
I wanna log the expected output and the error messages