I'm running a FME Workbench from my Python script and I struggle to print the log in the cmd.
When I run the FME Workbench (from FME without Python), I got this error in the FME translation log :
2022-04-20 10:15:57| 4.7| 0.2|ERROR |Bulk copy failed on table 'test_fme.SIG.ESP_NET_ApportVolontaire' using delimiter ':'. Error was 'ERROR: null value in column "objectid_sde" violates not-null constraint
DETAIL: Failing row contains (83858, null, 29019, 26/01/2022, GV, La poste st jacques_GV (ER), provisoire, GV142A1, null, null...'
I'd like this log to be printed in the cmd when I run the FME Workbench with Python. I got a loop for that :
for couche in ListeCouches :
try :
parameters = {}
parameters['FEATURE_TYPES'] = couche
workspace.runWithParameters(workspace_path,parameters)
print(couche)
except Exception as ex:
print(ex)
continue
I've read stuffs with
logger = fmeobjects.FMELogFile()
logger.logMessageString("{}".format('Error'), fmeobjects.FME_ERROR)
but I don't understand what to do with.