Merge pull request #207 from balabit/f/template-related-refactors

F/template related refactors
messages: add msg_warning_once() macro

This patch implements msg_warning_once() macro, that causes the warning
to be printed once per syslog-ng execution. This pattern is being
used at a number of places in syslog-ng, but so far has been open-coded
at all sites. This macro makes it possible to refactor all such sites,
reducing the code considerably.

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
global: use msg_warning_once() instead of open coding the same

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
cfg: display warning about duplicate configuration elements only once

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
afmongodb: remove exclamation from warning messages

All other warning call sites use WARNING: and not WARNING!, do the same in
the mongo driver too.

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
dbparser: only display the change in inject-mode() once per startup

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
Merge pull request #208 from balabit/f/msg-warning-refactor

F/msg warning refactor
cfg-tree: increase buffer for formatting the location in debug messages

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
cfg-tree: add log_expr_node_location_tag() function

This new function formats a "location" tag to be emitted as a name-value
pair associated with an internal message. This makes it trivial
to add this information to internal messages.

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
logpipe: add log_pipe_location_tag() function

This function formats a "location" tag to be emitted as a name-value
pair of internal messages.

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
global: use log_pipe_location_tag() and log_expr_node_location_tag()

Signed-off-by: Balazs Scheidler <bazsi@balabit.com>
Merge pull request #209 from balabit/f/location-tag-refactor

F/location tag refactor
basicfuncs: add implementation for $(template)

This function makes it possible to invoke other templates defined
in the configuration, like this:

   $(template foobar)

Assuming "foobar" is defined as a global template, this will invoke that,
and place its result as the result of the $(template) function.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>