Pretty plugin: only print negative timestamp warning once per component
[babeltrace.git] / plugins / text / pretty / print.c
index e698f4bd6671e87e6cec52bc115e25d42068e03a..7cf9434d969fb550b36f66536453f7c511d06835 100644 (file)
@@ -191,9 +191,10 @@ void print_timestamp_wall(struct pretty_component *pretty,
                struct tm tm;
                time_t time_s = (time_t) ts_sec_abs;
 
-               if (is_negative) {
+               if (is_negative && !pretty->negative_timestamp_warning_done) {
                        // TODO: log instead
                        fprintf(stderr, "[warning] Fallback to [sec.ns] to print negative time value. Use --clock-seconds.\n");
+                       pretty->negative_timestamp_warning_done = true;
                        goto seconds;
                }
 
This page took 0.025542 seconds and 4 git commands to generate.