1. add the parameter to generate the specific diagram
1. change print to appendLog