modify log function