Add logging log template

C++ template to log a message to journald.
Usage:
    log<level::XX>(const char*, entry(*format), entry()...);
    log<level::XX>(char*, entry(*format), entry()...);
Example:
    log<level::DEBUG>(
        msg("Simple Example"));
    char *msg_str[] = "File not found";
    log<level::DEBUG>(
        msg_str,
        entry("MY_METADATA=%s_%x, name, number));
An std::string can be passed via: example_string.c_str()),
and entry("EXAMPLE_STRING=%s", example_string.c_str())).
A future enhancement would be for 'entry' tuples to be
individually validated with a similar approach as the gcc
attribute format.

Change-Id: I82f4450468cc0676458a0ce56cf33c934a1a66ef
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed
tree: a3bb1d550a7f0ff373202c4dbc4f661336265ae3
  1. LICENSE
  2. log.hpp