Added writing the error and warnings to a log file "cs_log.txt"