init logger python code example
Example 1: python log to file and console
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s",
handlers=[
logging.FileHandler("debug.log"),
logging.StreamHandler()
]
)
Example 2: python fme logger
logger = fmeobjects.FMELogFile()
logger.logMessageString("{}".format('Error'), fmeobjects.FME_ERROR)