Skip to main content

Print Sample Data

The print hook prints processed samples to the standard output or into a file. While doing so, it supports all the formats described here: Format Types . It can also optionally prefix each line of output with a user definable prefix in order to distinguish the output of multiple print hooks.

Implementation​

The source code of the hook is available here: https://github.com/VILLASframework/node/blob/master/lib/hooks/print.cpp

Configuration​

output
string
Default: "/dev/stdout"

An optional path to a file to which the samples processed by this hook will be written to.

Format Object (object) or Format Name (string) (format_spec)
prefix
string
Default: ""

An optional prefix which will be prepended to each line written by this hook to the output

enabled
boolean
Default: true

An optional field which can be used to disable a hook.

priority
integer
Default: 99

The priority of this hook which determines the order in which hooks are executed. Hooks with a lwoer priority are executed before ones with a higher priority.

If no priority is configured, hooks are executed in the order they are configured in the configuration file.

{
  • "output": "/dev/stdout",
  • "format": "villas.human",
  • "prefix": "",
  • "enabled": true,
  • "priority": 99
}

Example​

node/etc/examples/hooks/print.conf
@include "hook-nodes.conf"

paths = (
{
in = "signal_node"
out = "file_node"

hooks = (
{
type = "print"

output = "print_output_file.log"
format = "villas.human"
# prefix = "[file_node] " # Prefix and output are exclusive settings!
}
)
}
)