Filtering tool messages by severity level

As I mentioned in the last recipe, all tools generate a number of messages that can be classified as information, warning, or error messages. The GetMessages() method accepts a parameter that allows you to filter the messages that are returned. For example, you may not be interested in the informative or warning messages in your script. However, you are certainly interested in error messages as they indicate a fatal error that will not allow a tool to successfully execute. Using GetMessages(), you can filter the returned message to only error messages.

Getting ready

Messages are classified into one of the three types, which are indicated by a severity level. Informational messages provide descriptive information ...

Get Programming ArcGIS 10.1 with Python Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.