Skip to content

Conversation

@zdykstra
Copy link
Member

@zdykstra zdykstra commented Feb 16, 2021

This PR is an attempt to make logging play a more focused role in the ZBM ecosystem. Various components would correctly catch and log an error through zerror(), but unless you know how to look for them, they were entirely hidden from view. As such, I attempted to meet the following goals:

  • Where an error is critical, (kexec, duplicating a BE), show a prompt and log an error
  • For all other error conditions, log an error with enough contextual information
  • When an error is generated, show an indicator on the main screen
  • Allow the error log to be viewed on any selector screen via MOD-L

In addition to the error log integrations, I made a pass through virtually every function in zfsbootmenu-lib.sh. Where positional parameters are non-optional in a function call, a test for empty is performed for each parameter. If the parameter is empty, an error is logged and and the function returns. Some functions had a check / silent return, others did not. They've all been normalized.

I've tested the behavior with an x86_64 BE in a ppc64le VM to confirm kexec and chroot error handling.

Are there any other error conditions that should warrant a timed_prompt, or should the current usage be pared back?

One side effect of this work is that the heavy usage of zdebug() does have a performance impact, so booting ZBM with loglevel=7should now only be done if you actually need debug level logging. Nothing is free.

@zdykstra zdykstra marked this pull request as draft February 16, 2021 22:45
@zdykstra zdykstra marked this pull request as ready for review February 18, 2021 02:35
@zdykstra zdykstra changed the title [WIP] Logging lifecycle Logging lifecycle Feb 18, 2021
@zdykstra zdykstra requested a review from ahesford February 18, 2021 02:35
Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good in general. We can run it through some more rigorous testing as part of the next release.

@zdykstra zdykstra merged commit 29cf15c into master Feb 18, 2021
@zdykstra zdykstra deleted the logging-lifecycle branch February 18, 2021 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants