importing logging in a custom filter

I have a custom filter and I have been trying to add logging, but can’t make it work, Paraview GUI keeps crashing and I have no idea why.

I have tried something like

import vtk
import math
import numpy as np
import numpy.linalg as la

from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase
from vtkmodules.vtkCommonDataModel import vtkDataSet

from paraview.util.vtkAlgorithm import smproxy, smproperty

from vtk.numpy_interface import algorithms as algs
from vtk.numpy_interface import dataset_adapter as dsa
import logging

logging.basicConfig(filename='app.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s')
logging.warning('This will get logged to a file')

@smproxy.filter(label="Custom Markers Filter")
class CustomMarkersFilter(VTKPythonAlgorithmBase):
    def __init__(self):

    def RequestData(self, request, inInfo, outInfo):'Requesting Data')
        inp = vtkDataSet.GetData(inInfo[0])
        dsaInp = dsa.WrapDataObject(inp)

        points = dsaInp.GetPoints()

        centers = identify_markers(points)

        M1_, M2_, M3_ = centers
        print("M1': " + str(M1_))
        print("M2': " + str(M2_))
        print("M3': " + str(M3_))

        # Create vtkPoints from markers centers
        pts = vtk.vtkPoints()
        for p in centers:

        opt = vtkDataSet.GetData(outInfo)
        dsaOpt = dsa.WrapDataObject(opt)


        numPts = pts.GetNumberOfPoints()

        ptIds = vtk.vtkIdList()
        for a in range(numPts):
            ptIds.SetId(a, a)

        dsaOpt.InsertNextCell(vtk.VTK_POLY_VERTEX, ptIds)

        return 1

I have also tried to initialize inside the class without success either.

Is there any way to get feedback even when the app crash?

Do you have an error message to share ?