• M
    Add a metadata parameter to virLog{, V}Message · c780e9b8
    Miloslav Trmač 提交于
    ... and update all users.  No change in functionality, the parameter
    will be used later.
    
    The metadata representation is as minimal as possible, but requires
    the caller to allocate an array on stack explicitly.
    
    The alternative of using varargs in the virLogMessage() callers:
    * Would not allow the caller to optionally omit some metadata elements,
      except by having two calls to virLogMessage.
    * Would not be as type-safe (e.g. using int vs. size_t), and the compiler
      wouldn't be able to do type checking
    * Depending on parameter order:
      a) virLogMessage(..., message format, message params...,
                       metadata..., NULL)
         can not be portably implemented (parse_printf_format() is a glibc
         function)
      b) virLogMessage(..., metadata..., NULL,
                       message format, message params...)
         would prevent usage of ATTRIBUTE_FMT_PRINTF and the associated
         compiler checking.
    Signed-off-by: NMiloslav Trmač <mitr@redhat.com>
    c780e9b8
logging.c 39.9 KB