On Thu, Sep 1, 2016 at 12:07 AM, Stefan Beller <sbel...@google.com> wrote:
>> Printing on stdout, and calls to warning() or error() are not
>> taken care of in this patch, as that will be done in following
>> patches.
>
>> -               if (state->apply_verbosely)
>> +               if (state->apply_verbosity > verbosity_normal)
>>                         error(_("while searching for:\n%.*s"),
>>                               (int)(old - oldlines), oldlines);
>
> But this is an error(..) ?

Do you mean that it was a bug in the original code to print this error
only in verbose mode?

> Have you considered to replace all these print functions (error, warning,
> fprintf, printf, fprintf_ln) with another custom
>
>     int say_when_at_least(verbosity level, const char *fmt,...)
>
> ? (I guess that would be more invasive, but the result would be more
> consistent.)

My opinion is that there is a reason (or there should have been a
reason) why people decided to use error() instead of warning() for
example.
If I use say_when_at_least(verbosity level, const char *fmt,...) like
you suggest, how do I decide if error() or warning() is used to
actually print the error message?
Another parameter to this function (severity level?) is needed.

Anyway I don't think such a refactoring is needed.

Reply via email to