Hi Stephen,
On 21/02/2026 06:39, Stephen Hemminger wrote:
On Fri, 20 Feb 2026 19:54:02 +0100
"Matthieu Baerts (NGI0)" [off-list ref] wrote:
quoted
Only if the output stream is 'stdout', because all JSON helpers like
print_string() only write on 'stdout'.
Supporting JSON is easy with the helpers. The biggest modification is to
extract the end value.
No behavioural changes intended for the moment, this is a preparation for a
future usage of print_timestamp() within a JSON context.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
I would go farther, fp is always stdout. Drop the argument to the function.
Good idea!
To be coherent with the rest, I started to look at removing the same
argument from the caller functions, and similar ones. I did a very quick
draft with a few sed, etc. but I'm not sure whether I should take this
direction:
https://github.com/matttbe/iproute2/commit/585b0109
WDYT? Or should I only drop fp from print_timestamp()? Or simply not use
it like it is done in many other helpers supporting JSON?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.