[libbluray-devel] patch to clean up debug logging
hpi
hpi.libbluray at gmail.com
Tue Mar 29 13:17:11 CEST 2011
Hello!
Erik Van Grunderbeeck wrote:
> Makes compilation work with intel compiler,
Did you try if C99 version works with ICC ? Something like:
#define DEBUG(MASK,...) bd_debug(__FILE__,__LINE__,MASK,__VA_ARGS__)
It works with gcc, and removing one parameter from macro definition is
not a problem ... Y is not very informative name anyway :)
This isn't big issue, I'm ok with the ones in patch too.
> centralizes debug macro’s,
I'll rename those local TRACE/ERROR macros to something else.
TRACE() should be possible to disable at build time (by default) when
the module is stable enough. It is already disabled in m2ts demuxer and
graphics processor, but the patch enables it again :)
To be generic enough BD_ERROR() should take also debug mask, so it would
look something like
#define BD_ERROR(MASK,...) bd_debug(__FILE__,__LINE__,MASK|DBG_CRIT,__VA_ARGS__)
> renamed them
Looks good, I'll apply soon.
> diff --git a/src/util/logging.c b/src/util/logging.c
> index ee50acd..b48462f 100644
> --- a/src/util/logging.c
> +++ b/src/util/logging.c
> @@ -64,11 +64,11 @@ void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...
> logfile = stderr;
>
> char *env = NULL;
> - if ((env = getenv("BD_DEBUG_MASK")))
> + if ((env = getenv("DEBUG_MASK")))
> debug_mask = strtol(env, NULL, 0);
>
> // Send DEBUG to file?
> - if ((env = getenv("BD_DEBUG_FILE"))) {
> + if ((env = getenv("DEBUG_FILE"))) {
> logfile = fopen(env, "wb");
> setvbuf(logfile, NULL, _IOLBF, 0);
> }
This seems to be unrelated change ?
I don't think changing the environment variables back to (very common)
names is good. Those were changed to BD_* when those collapsed with
libaacs ones.
More information about the libbluray-devel
mailing list