modify logging and add gflag