I am writing a logger that capture the output of a script, and handle that output differently if the previous program fail or succeed:
program1 | logger.sh