对数表达式Expressions

The对数表达式出口ession allows for easy logging. While it can also evaluate to a string (usually the message being logged), its primary purpose is to generate a log entry. It is represented in the xfMap document with theelement, and it has the following general form:

  ... ... 

Note:The logexpr expression supports positional arguments for backwards compatibility, but named arguments are recommended.

使用位置参数时,logexpr表达式采用以下形式:

<!--要返回的表达式-->

When using positional arguments, the order of the two arguments cannot be changed and in order to specify return as an arg, expr must also be specified.

The表达式字符串(i、 例如出口attribute) specifies a string to enter in the log. The返回attribute specifies a value to evaluate to, and theseverityattribute determines the type of log message entered into the log. All these attributes are optional, and both出口返回属性可以由这两个参数指定。如果指定了任何参数,则出口返回将被忽略。不可能混合和匹配这些属性和参数。

如果未指定返回值(在参数或属性中),则表达式的计算结果为日志中输入的消息。如果对数表达式is being used solely in order to enter a log message, the return attribute or argument must be specified to be the empty string.

Theseverity属性是可选的,如果未指定,则默认为“通知”。

The限制attribute is optional. This attribute determines the maximum number of log messages to display. After this number of messages have been logged, additional log messages resulting from the对数表达式表达被抑制。此事件的通知以单个日志消息的形式提供,说明将抑制进一步的日志消息。如果限制属性未指定,则不设置限制。

如果suppress-limit-warningattribute is specified and set to true, then no notification will be provided when the对数表达式记录日志的最大数量我表达ssages as provided in the限制属性。

The frequency attribute is optional can be used to control how often messages are logged. The value of this attribute specifies the number of times a logexpr is activated before a message is logged. If both frequency and limit attributes are specified, it is only when a message is logged that the limit count is incremented.

例子

项目.xml

键15.002

项目.xmp

><!--请注意,日志消息将成为名称-->     
记录的消息======================================================================================…|通知|找到项1…|警告|找到两个…|通知|找到项3的键,值为5.002====================================================================
构造的特征+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...|INFORM|Feature Type: `keys' ...|INFORM|Attribute(string): `item-1' has value `key 1' ...|INFORM|Attribute(string): `item3' has value `5.002: key5 expected' ...|INFORM|Attribute(string): `itemtwo found' has value `2' ...|INFORM|Attribute(string): `xml_type' has value `xml_no_geom' ...|INFORM|Geometry Type: Unknown (0) =================================================================== ===================================================================