replace cout with log system