I used the command to suppress the screen output
latex -quiet foo.tex
--quiet is implemented in MiKTeX's executables and removes all the stuff from the output stream except for the errors.
It displays as below
but the MiKTeX error should display like below
foo.tex:3: Undefined control sequence
Here the error message not showing. It shows only line number. Please advise.