So we report our progress in % to our UI. We do this by getting the progress from “mender” i.e. mender client. We piped the output from mender indirectly to the UI
we did use mender client 1.x (in sumo) the output went to stout.
I think since the upgrade to mender client 2.x (dunfell) the progress is not going to sdout.
It display it on the terminal but it doesn’t seemed to get piped anymore.
I have tired various logging options. No joy
What is the correct way of getting the progress from mender client.
In modern versions of mender, the progress for standalone install is written interactively to stdout. I think it might be hard to parse and update your GUI from that, though.
You’ll get something like:
INFO[0003] Opening device "/dev/hda3" for writing
INFO[0003] Native sector size of block device /dev/hda3 is 512 bytes. Mender will write in chunks of 1048576 bytes
............. - 21 %
and eventually:
......................................................................
time="2022-09-21T08:56:14Z" level=info msg="All bytes were successfully written to the new partition"
I have successfully parsed numeric output for projects, however, something to be aware of, early versions had an incrementing percentage numeric in the output, then at some point it was removed, this required me to create a custom patch for progress.go on my Yocto mender recipe to replace the new progress renderer with the old one. I had been meaning to create a ticket for this, as there should really be an option to change the type of progress renderer rather than replace it, as this was a breaking change for me.
If it helps or serves as a starting point, the patch for my projects is below and may or may not apply cleanly depending on your version being used.