[U-Boot] [RFC] env: Fix errors printing on env loading
Wolfgang Denk
wd at denx.de
Thu Jul 19 19:43:21 UTC 2018
Dear Sam,
In message <20180718213736.22650-1-semen.protsenko at linaro.org> you wrote:
> This is just a draft to discuss ideas related to "Make U-Boot log great
> again" thread.
>
> With this patch we will have something like this:
>
> Attempting to load environment from FAT:
> MMC: no card present
> ** Bad device mmc 0 **
> Failed (-5)
> Attempting to load environment from MMC: OK
>
> instead of this:
>
> Loading Environment from FAT... MMC: no card present
> ** Bad device mmc 0 **
> Failed (-5)
> Loading Environment from MMC... OK
The new output is worse, as it consumes even more lines of output.
> The only way I see to do so is to use ASCII escape codes for moving the
> cursor (in non-error case).
NAK!!! Please keep in mind that output usually goes to a serial
port, and should not assume any speific "terminal" capabilities.
Even simple in-line "editing" like "overprinting by outputting
backspace characters causes a LOT of hassle when you try to parse
output for example in automatic test suites.
Adding more complex terminal control or other fancy stuff (like
colors etc) is a _strict_ no, no!
> I'd also like to add prefixes to error messages, like it's done in [2],
> but it requires adding one pointer to global data struct.
As I explained befoire, this has a lot of negative consequences.
You think about beauty, but please keep functionality and efficiency
(boot time) in mind!
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's an old proverb that says just about whatever you want it to.
More information about the U-Boot
mailing list