code: def set_error_output_file(filename):
      
      filename = os.path.abspath(os.path.expanduser(filename))
      fileOutputWindow = vtk.vtkFileOutputWindow()
      fileOutputWindow.SetFileName(filename)
      outputWindow = vtk.vtkOutputWindow()
      outputWindow.SetInstance(fileOutputWindow)
      return fileOutputWindow, outputWindow
docs: Sets a file to write out the VTK errors