Skip to content

Commit

Permalink
template: add warning about unrendered binary values
Browse files Browse the repository at this point in the history
It took me a while to realize why the output is not rendered in our
light tests, once I removed $MSG as a macro. This message would have
helped me a lot.

Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi committed Jan 6, 2025
1 parent d13b7c5 commit 5da76da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/template/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ log_template_append_elem_value(LogTemplate *self, LogTemplateElem *e, LogTemplat
}
else if (value_type == LM_VT_BYTES || value_type == LM_VT_PROTOBUF)
{
msg_warning_once("template: not rendering binary name-value pair, use an explicit type hint",
evt_tag_str("template", self->template_str),
evt_tag_str("name", log_msg_get_handle_name(e->value_handle, NULL)),
evt_tag_str("type", log_msg_value_type_to_str(value_type)));
value_type = LM_VT_NULL;
}
*type = _propagate_type(*type, value_type);
Expand Down

0 comments on commit 5da76da

Please sign in to comment.