Hi Rogerio,
On 3/17/25 11:53 PM, Rogerio Guerra Borin wrote:
[You don't often get email from rogerio.bo...@gmail.com. Learn why this is
important at https://aka.ms/LearnAboutSenderIdentification ]
Add switch -q for quiet operation to all fuse subcommands. This helps
avoid bloating the console with messages that can be distracting to
users (particularly when the command is employed by scripts and multiple
fuse values are read/compared/programmed). For example, the "fuse cmp"
command normally produces five lines of output:
U-Boot # fuse cmp 6 0 0x70af49db
Comparing bank 6:
Word 0x00000000:
Value 0x70af49db:0x70af49db
passed
U-Boot # echo $?
0
But scripts issuing the command do not know or care about that output
since the command exit code is the only relevant information visible to
them. With the new switch one can avoid the unnecessary output:
U-Boot # fuse cmp -q 6 0 0x70af49db
U-Boot # echo $?
0
I think this is a reasonable expectation. I'm wondering if we shouldn't
think about using the log architecture we have to have a generic
solution rather than expecting each command driver to handle (possibly
in their own way) a quiet flag.
https://docs.u-boot.org/en/latest/develop/logging.html
The idea I have in mind is that we could dynamically set the loglevel
for a specific command driver (or at least for the command subsystem (by
e.g. defining an LOG_CATEGORY LOGC_CMD) and use log_* functions in the
command driver rather than IF_NOT_QUIET() below. This would also allow
different log levels to be used. Maybe there's something to be done with
filters, or something new needs to be added to set the log level for a
category maybe? I don't know, not too verse in our log system.
Another option to have a generic logic would be to depend on an
environment variable instead of needing to expand each command driver's
logic.
Cheers,
Quentin