log and emit alert instead of printing to stdout