This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I want to save all the screen output such as printf output messages into a log file. As on board there is no tee command, we could not use "./run.sh | tee > log.txt". The ./store_log.sh could just save the system messages.
Could someone know how to save all the messages released by the program?
Thanks in advance!
If you don't want anything displayed on the console you can just use ./run.sh > log.txt. If you want both output on console and logs only option I think is to use tee.You can pick tee from the RDK rootfs packaged with the release.Note that write to pipe will be buffered and the final logs may not get written to the file. To avoid this you should have below line in your application:
/* Set for line buffering so that even if output is piped buffering does not happen */
setvbuf(stdout, NULL, _IOLBF, 0);
Hi Badri,
Thanks a lot for your reply! I don't quite understand where to get tee in DVRRDK. Do you mean that it was packaged in the root filesystem?
Hi Badri,
I find busybox on board. I try to use ./run.sh | busybox tee > log.txt and it works.
Thanks very much!