Houdini 20.5 Nodes APEX nodes

Log

Adds an APEX log entry to the log viewer.

On this page
Since 20.5

Adds a message, warning, or error entry to the log viewer under the APEX log type. To open the log viewer, click the New Tab icon at the top of a pane and select New Pane Tab Type ▸ Log Viewer.

If the graph that contains this node is invoked from an APEX Invoke Graph SOP, the log message is also reported to the SOP and displayed in the node info window.

As with printf() formatting, the formatted string contains replacement fields that are surrounded by curly braces {} (rather than prefixed with a %). These replacement fields are substituted with the textual representation of the inputs.

Note that the string '{{' or '}}' results in a single '{' or '}' being output.

See APEX Script logging for information on how to output log messages in APEX Script.

Format Grammar

The grammar for the replacement field is as follows:

{[<index>][:<spec>]}

The <index> is an optional integer value that refers to the position of the argument after the format string. If the <index> is omitted for all replacement fields, they are automatically substituted with 0, 1, 2, .... It is not permitted to mix indexed and non-indexed replacement fields.

If a colon separator is found, the string after the colon is interpreted as a formatting specification. The grammar for the <spec> field is as follows:

[[<fill>]<align>][<sign>][#][,][0][<width>][.<precision>][<type>]

Field

Description

<fill>

The fill character to use when the width of the field is greater than the length of the argument value being printed.

<align>

A single character code that sets the alignment of the value within the field:

  • <: The field is left-aligned. This is the default for non-numeric values.

  • >: The field is right-aligned. This is the default for numeric values.

  • ^: The field is center-aligned.

  • =: The field is number aligned. This is the same as right-aligned, except the fill value is inserted between the sign indicator and the numeric value. This alignment is only available for numeric values.

<sign>

A single character that specifies how the sign is printed for numeric values:

  • +: Always print a sign, whether positive or negative.

  • -: Only print a sign when the number is negative.

  • <space>: Use a leading space on positive numbers, and a minus sign for negative numbers.

#

This option is only available for binary, octal or hexadecimal outputs. It indicates that they should be prefixed with '0b', '0' and '0x', respectively.

,

This option adds digit grouping to numerical outputs. For float numbers, this only applies to the integer portion of the float.

<width>

Specifies the minimum width of the field. Arguments wider than this value are still printed out in full. Preceding the width field with 0 automatically sets the alignment to number alignment, and the fill value to 0.

<precision>

Sets the precision for floating point numbers. For other types, it specifies the maximum width of the field.

<type>

A single character code that specifies how the type should be interpreted. If an argument type is not valid for the formatting type, the formatting type is ignored. The supported types are:

  • b: Output integers as binary numbers.

  • B: Output integers as binary numbers with an uppercase prefix (if using the # option).

  • c: Output integers interpreted as a Unicode code point.

  • d: Output integers as decimal numbers. This is the default for integers.

  • e: Use the exponent notation for floating point numbers.

  • E: Same as e, except the exponent separator is uppercase.

  • f: Use the fixed point notation for floating point numbers.

  • F: Same as f.

  • g: Format a floating point number as either fixed point or scientific, depending on its magnitude, which mostly results in the shortest form being used. This is the default for floats.

  • G: Same as g, except the exponent separator is uppercase.

  • o: Output integers as octals.

  • x: Output integers and floats as hexadecimal. For floats, this uses the special hexadecimal float output.

  • X: The same as x, except all alphabetic digits and prefixes are output in uppercase.

  • %: Takes a floating point number, multiplies it by 100, and outputs it with a percentage sign appended, using fixed point notation. The default precision in this mode is 2.

Inputs

args0 Required

The input that replaces the first {} substring in formatstring. This port and its corresponding output must be wired to execute this node.

severity: Int

The severity of the log entry. The supported values are:

  • 0: Message

  • 1: Warning

  • 2: Error

No entry is added to the log for any other value.

formatstring: String

The formatted string for the log entry, where the {} substrings are replaced with their corresponding input values.

args: VariadicArg<void>

The input values that replace the {} substrings in formatstring, starting with args0.

Outputs

args0

The args0 input, unaltered.

See also

APEX nodes