Browse Source

tracer: json: add support for unsigned integers

pull/177/head
Alexandre Janniaux 1 year ago
committed by Steve Lhomme
parent
commit
5695e0c853
  1. 9
      modules/logger/json.c

9
modules/logger/json.c

@ -138,6 +138,12 @@ static void JsonPrintKeyValueNumber(FILE *stream, const char *key, int64_t value
fprintf(stream, ": \"%"PRId64"\"", value);
}
static void JsonPrintKeyValueUnsigned(FILE *stream, const char *key, uint64_t value)
{
JsonPrintString(stream, key);
fprintf(stream, ": \"%"PRIu64"\"", value);
}
static void JsonPrintKeyValueNumberFromDouble(FILE *stream, const char *key, double value)
{
JsonPrintString(stream, key);
@ -181,6 +187,9 @@ static void TraceJson(void *opaque, vlc_tick_t ts, const struct vlc_tracer_trace
{
switch (entry->type)
{
case VLC_TRACER_UINT:
JsonPrintKeyValueUnsigned(stream, entry->key, entry->value.uinteger);
break;
case VLC_TRACER_INT:
JsonPrintKeyValueNumber(stream, entry->key, entry->value.integer);
break;

Loading…
Cancel
Save