In a PythonCaller (or PythonCreator) transformer, messages are added to the logfile with the FMELogFile object, which is part of the fmeobjects. You need to create a logger object: logger = fmeobjects.FMELogFile() and then you will need to send messages to the logger: logger.logMessageString("Hello I am Logging Now")
If your python script completes without errors but lacks output, check for print statements to ensure results are displayed. Verify input handaling and run the script interactively for step by step debugging. Look for silent errors in the console and test with sample data to confirm expected behavior.
I did not look into all the PythonCaller code before.
FME is in principal a NoCode application to do all the things you want to do. It looks like you don't have much experience in coding in Python or using Python in FME.
The function you are writing is very easy to do using 1 or 2 transformers, so it looks like you should keep away from the PythonCaller.
Except when your only goal is to learn to use the PythonCaller in general because you are certain that there are things you want to do that FME can't do with basic transformers.