Update log.h

optimize log.h for write