SetMessageLevels

摘要

用于设置要与地理处理工具消息一起返回的附加信息性消息类别。

可以使用多个 ArcPy 函数访问地理处理消息,包括 GetMessagesGetAllMessages

说明

注:

此函数不考虑附加信息性消息选项的设置方式。

语法

SetMessageLevels (levels)
参数说明数据类型
levels
[levels,...]

Specifies the categories of messages that will be included in geoprocessing tool messages.

  • NORMALOnly standard tool messages will be included. This is the default.Standard tool messages will be always be included. Use this option to reset back to the default, if other options have been previously set.
  • COMMANDSYNTAXThe tool messages will include a command syntax message. Command syntax is not Python code. It's a space-delimited string of the tool name and the parameter values used to run the tool.
  • DIAGNOSTICSThe tool messages will include diagnostic messages. The messages include details about geoprocessing preprocessing and postprocessing, geoprocessing thread disconnecting and reconnecting, and more. Diagnostic messages are the same as the geoprocessing event messages logged in the ArcGIS Pro Diagnostic Monitor. Esri staff uses diagnostic messages to troubleshoot geoprocessing tool issues.
  • PROJECTIONTRANSFORMATIONThe tool messages will include geographic transformation-related messages. These messages are applicable when a tool requires transforming input datasets to a different coordinate system.

Multiple options can be set using a list. A single option can be set as a string or a list.

(默认值为 NORMAL)

String

代码示例

SetMessageLevels 示例

可以使用 SetMessageLevels 以返回带有地理处理工具消息的语法消息。

import arcpy

arcpy.SetMessageLevels(['COMMANDSYNTAX'])

相关主题