Reputation: 2242
I am running a program under console. It keep outputting debug messages on screen. If do like this,
$./myProgram >> log.txt
then I cannot see the debug message on screen, all the messages are going to the log.txt.
So, how do I log the messages into log.txt and show the debug message on screen as well?
Thanks in advance.
Upvotes: 1
Views: 1847
Reputation: 1275
Assuming you're logging to stdout:
$./myProgram | tee log.txt
EDIT
If you choose to log errors to stderr
then it might be useful to call you prog like this (stderr goes to one file, stdout goes to another file and to screen):
$./myProgram 2>error_log.txt | tee output_log.txt
Upvotes: 5