Debugging JavaScript function in SHACL-JS

I am using SHACL-JS to perform validation on RDF data. The validation requires some mathematical computations, which I am doing using a JS function, which is being called from the SHACL-JS shape. I am utilizing SHACL-X to implement SHACL-JS. The JavaScript function receives arguments from the SHACL shape during data validation. However, it is throwing errors, and I am unable to understand why. I tested the JS function separately with arbitrary arguments, and it worked fine. However, when it is being called from the SHACL shape, it is not working appropriately.

To debug the issue, I thought of checking if the arguments are being passed correctly to the JS function. To that end, I added some console.log statements in the JavaScript function, as shown in the snippet below:

var centerofrotationBoom = convertPointStringToArray($centerofrotationBoom.getLex());
var centerofrotationBoomMast = convertPointStringToArray($centerofrotationBoomMast.getLex());
var centerofrotationAuxiliaryCounterweight = convertPointStringToArray($centerofrotationAuxiliaryCounterweight.getLex());
var centerofrotationLowerRotatingBody = convertPointStringToArray($centerofrotationLowerRotatingBody.getLex());
var centerofrotationBoomMastPendants = convertPointStringToArray($centerofrotationBoomMastPendants.getLex());
var centerofrotationSuperliftPendants = convertPointStringToArray($centerofrotationSuperliftPendants.getLex());
var polyhedralSurfaces = [];
let surfaceInConcatSurface = $concatSurfaces.getLex().split(" // ");
console.log(surfaceInConcatSurface);
for (let i=0; i<surfaceInConcatSurface.length; i++){
    polyhedralSurfaces.push(convertPolyhedralSurfaceStringToArray(surfaceInConcatSurface[i]));
}
console.log(polyhedralSurfaces);

However, it seems that these log statements are not working when the function is being called from SHACL-JS shape, as I do not see any output in the server log. The server log is shown below.

2024-07-11 14:20:39 /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
2024-07-11 14:20:39 /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
2024-07-11 14:20:39 /docker-entrypoint.sh: Configuration complete; ready for start up
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: using the "epoll" event method
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: nginx/1.25.4
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r10) 
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: OS: Linux 5.15.153.1-microsoft-standard-WSL2
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker processes
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 30
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 31
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 32
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 33
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 34
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 35
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 36
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 37
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 38
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 39
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 40
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 41
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 42
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 43
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 44
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 45
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 46
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 47
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 48
2024-07-11 14:20:39 2024/07/11 02:20:39 [notice] 1#1: start worker process 49
2024-07-11 14:27:02 172.19.0.3 - - [11/Jul/2024:02:27:02 +0000] "GET /RotationalConstraintChecking.js HTTP/1.1" 200 318975 "-" "Java/17.0.11" "-"

Is there a way to print or log something from the JavaScript code while it is being called from the SHACL-JS shape? Any insights or suggestions on how to troubleshoot this issue would be highly appreciated.

Best Regards,
Ajay