from psdi.util.logging import MXLoggerFactory
from psdi.util.logging import MXLogger
try:
Exceptions Handling
from psdi.util.logging import MXLogger
try:
log = MXLoggerFactory.getLogger("maximo.application.AUTOSCRIPT")
scriptname="<script name>"
log.info("******Entering Autoscript : " +scriptname +"******")
log.debug("[DEBUG] script "+scriptname+" <Message>")
log.info("******Existing Autoscript : " +scriptname +"******")
Exceptions Handling
except Exception, e:
print >> sys.stderr, "[ERROR] script "+scriptname+" failed: ",e.message
print >> sys.stdout, "[ERROR] script "+scriptname+" failed: ",e.message
log.error("[ERROR] script "+scriptname+" failed: " +e.message)
No comments:
Post a Comment