out_stdout: use nanosecond API
#include <fluent-bit/flb_output.h>
#include <fluent-bit/flb_utils.h>
-
+#include <fluent-bit/flb_time.h>
#include <msgpack.h>
#include "stdout.h"
@@ -47,12 +47,16 @@ void cb_stdout_flush(void *data, size_t bytes,
(void) i_ins;
(void) out_context;
(void) config;
+ flb_time tmp;
+ msgpack_object *p;
msgpack_unpacked_init(&result);
while (msgpack_unpack_next(&result, data, bytes, &off)) {
- printf("[%zd] %s: ", cnt++, tag);
- msgpack_object_print(stdout, result.data);
- printf("\n");
+ printf("[%zd] %s: [", cnt++, tag);
+ flb_time_pop_from_msgpack(&tmp, &result, &p);
+ printf("%"PRIu32".%09lu, ", (uint32_t)tmp.tv_sec, tmp.tv_nsec);
+ msgpack_object_print(stdout, *p);
+ printf("]\n");
}
msgpack_unpacked_destroy(&result);
