[lvm-devel] master - dev-type: print log_sys_debug

Alasdair G Kergon agk at redhat.com
Fri Jul 4 17:22:18 UTC 2014


On Fri, Jul 04, 2014 at 10:32:04AM +0000, Zdenek Kabelac wrote:
> For non-fatal error use log_sys_debug as the tool
> is not stopping on these errors.

To be clear about the criteria for the different message levels:

If the code exits with an error status code there MUST have been a log_error.

But issuing a log_error does NOT mean the code must stop processing and exit.

Using log_error means "This is something the user needs to be told about".

That might include something that should never occur on a properly-functioning
system, but which if it does occur is not fatal to the continued processing
of the command.

Look at it the other way around:
  Given that the error *has* occurred, what can be deduced about the likely
  cause and does the user need to be aware of that cause in case they
  want to investigate it?

However, the cases where a log_error is non-fatal should be quite rare in the
code.

log_warn is for something that MIGHT lead to unexpected behaviour, incorrect
processing or irreversible change etc. but which MIGHT also be perfectly OK if
it was indeed the user's intention.  If there are NO circumstances where the
thing being reported is normal or expected, log_warn should NOT be used.

Alasdair




More information about the lvm-devel mailing list