Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using the Python Logging System

Similar presentations


Presentation on theme: "Using the Python Logging System"— Presentation transcript:

1 Using the Python Logging System
ACS Training Using the Python Logging System

2 Getting Started Open up: from your browser. SWC/LSO, October 2002 ACS Training

3 What’s Available in Python?
Full implementation of the C++ Logging System that is far easier to use and add support for including an ACS component or client’s name in the log message. SWC/LSO, October 2002 ACS Training

4 Example Normally you would just use the getLogger method
#!/usr/bin/env python from Acspy.Common.Log import getLogger logger = getLogger() #Get a Logger instance logger.logInfo('Test INFO message') logger.logTrace('Test TRACE message') logger.logDebug('Test DEBUG message') logger.logWarning('Test WARNING message') logger.logAlert('Test ALERT message') logger.logCritical('Test CRITICAL message') logger.logEmergency('Test EMERGENCY message') logger.logNotice('Test NOTICE message') Normally you would just use the getLogger method available from the ContainerServices Class (i.e., PySimpleClient and ACSComponent). An additional Parameter (i.e., a PySimpleClient or ACSComponent) could have been provided here thereby appending it’s name to all log messages. Notice a similar pattern emerging? SWC/LSO, October 2002 ACS Training

5 Example (continued) Look familiar?
import ACSErrTypeACSCourseImpl anError = ACSErrTypeACSCourseImpl.TargetNotFoundExImpl() logger.logErrorTrace(anError.getErrorTrace()) Look familiar? Or you can just simply use the “log” method of anError… SWC/LSO, October 2002 ACS Training

6 Questions about the Python Logging System???
SWC/LSO, October 2002 ACS Training

7 Demo SWC/LSO, October 2002 ACS Training


Download ppt "Using the Python Logging System"

Similar presentations


Ads by Google