Error while running SNAP command line

Which info message are you referring to?
If you see the ‘done’ then this processing has been completed and the process stops.
Depending on how you invoke the processing this might interfere with your Python script.
Have you tried maybe this is something you want to try.
Introducing snapista, a GPT wrapper for Python - Show Room - STEP Forum (esa.int)

How logging can be disabled is explained here: