Close log function