I have a workbench which has a complex custom transformer added in which a python caller is present. I wanted to check what is happening in that python caller so I used some print statements. But I cannot find those print statements in logs that is being generated. How to get the log of a custom transformer in FME Desktop 2019.
Solved
How to get log generated in custom transformer ?
Best answer by david_r
Print statements will appear in the on-screen log window, but will not necessarily be logged in the exact same order as the transformer messages, and may only appear on-screen and not in the log file.
The best way to log messages is to use the FMELogFile object in the fmeobjects API. Example:
import fmeobjects
def my_function(feature):
# Do something ...
# Sends a message to the FME log file and console window.
# Severity must be one of FME_INFORM, FME_WARN, FME_ERROR,
# FME_FATAL, FME_STATISTIC, or FME_STATUSREPORT.
message = 'This message will appear both on screen and in the log file'
severity = fmeobjects.FME_INFORM
fmeobjects.FMELogFile().logMessageString(message, severity)
# Do something else here...
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Login to the community
No account yet? Create an account
An FME Account is required to contribute
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.

