Bug 76694

Summary: Inconsistent behaviour of LIBGL_DEBUG
Product: Mesa Reporter: Stefan Brüns <stefan.bruens>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Stefan Brüns 2014-03-27 15:21:40 UTC
Mesa documentation states the following:

./docs/libGL.txt:stderr if the LIBGL_DEBUG environment variable is defined.
./docs/envvars.html:<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.

i.e. the corresponding codes check "if (getenv("LIBGL_DEBUG")) ...".

On the other hand, the loader code in src/glx/dri_common.c has a default log level of "_LOADER_WARNING", i.e. messages with log level WARNING and FATAL will be logged.

To lower the log level, LIBGL_DEBUG=quiet can be used for the loader, which in turn increases the log level for the rest of the library.
Comment 1 Timothy Arceri 2018-04-23 03:55:18 UTC
I'm not sure what you want here, so I'm going to close this bug report. If you think it should work differently please send a patch to the list for discussion. Thanks.
Comment 2 Stefan Brüns 2018-04-23 14:17:50 UTC
The important part is some code parts check for *defined*, while others check for a specific value, i.e. "quiet" and "verbose"

https://github.com/anholt/mesa/blob/master/src/glx/dri_common.c#L59
Comment 3 Timothy Arceri 2018-04-23 23:18:38 UTC
(In reply to Stefan Brüns from comment #2)
> The important part is some code parts check for *defined*, while others
> check for a specific value, i.e. "quiet" and "verbose"
> 
> https://github.com/anholt/mesa/blob/master/src/glx/dri_common.c#L59

Right but I don't think anyone cares enough to change this. Feel free to submit a patch to the mailing list and see what the other devs have to say, but we tend not to alter how these environment vars operate since people have memorised, scripted them etc.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.