[FFmpeg-devel] [RFC]lavu/log: Do not print pointer addresses for loglevel < debug

Nicolas George george at nsup.org
Tue Dec 17 20:36:29 EET 2019


Carl Eugen Hoyos (12019-12-16):
> From f164e22f185d6a3e69d3376246a41a6958dba215 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> Date: Mon, 16 Dec 2019 21:02:19 +0100
> Subject: [PATCH] lavu/log: Do not print pointer addresses for loglevel <
>  debug.
> 
> ---
>  libavutil/log.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)

It could make sense, but I think not exactly like that.

Right now, at loglevel info, we have:

[something @ 0x42] Info

And at loglevel debug, we have:

[something @ 0x42] Info
[something @ 0x42] Debug

With your change, that would become respectively:

(i) [something  Info

(d) [something] Info
(d) [something @ 0x42] Debug

It think it would be better to have:

(i) [something] Info

(d) [something @ 0x42] Info
(d) [something @ 0x42] Debug

In practice, it means testing av_log_level rather than level to
determine whether the address should be printed. That way, if the
address is needed (to distinguish different objects of the same type, as
Michael pointed), it can be: it is treating the address part itself as
level debug.

Also, maybe verbose rather than debug. I am not sure.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191217/9daa6cb7/attachment.sig>


More information about the ffmpeg-devel mailing list