trace: use warning() for printing trace errors
commit38f460caa26e5dd06c3e874e30ea0ec5beb49b56
authorJeff King <peff@peff.net>
Fri, 5 Aug 2016 07:56:00 +0000 (5 03:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Aug 2016 16:27:34 +0000 (5 09:27 -0700)
treef085b0f544cd577c54b4c999d85b08e8658245aa
parentc0222e762ef57c59fa793862618cfcdfef1cf3f8
trace: use warning() for printing trace errors

Right now we just fprintf() straight to stderr, which can
make the output hard to distinguish. It would be helpful to
give it one of our usual prefixes like "error:", "warning:",
etc.

It doesn't make sense to use error() here, as the trace code
is "optional" debugging code. If something goes wrong, we
should warn the user, but saying "error" implies the actual
git operation had a problem. So warning() is the only sane
choice.

Note that this does end up calling warn_routine() to do the
formatting. This is probably a good thing, since they are
clearly trying to hook messages before they make it to
stderr. However, it also means that in theory somebody who
tries to trace from their warn_routine() could cause a loop.
This seems rather unlikely in practice (we've never even
overridden the default warn_builtin routine before, and
recent discussions to do so would just install a noop
routine).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
trace.c