[cairo] CAIRO_DEBUG, take 2

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Thu May 8 08:19:36 PDT 2008


On Thu, 2008-05-08 at 22:45 +0930, Adrian Johnson wrote:

>  > To enable the debugging output, one simply sets the CAIRO_DEBUG
>  > environment
>  > variable to the list of facilities desired.
>  > $ CAIRO_DEBUG=option1[,option2[,...]]; export CAIRO_DEBUG
>  > e.g.
>  > $ CAIRO_DEBUG=backtrace,abort; export CAIRO_DEBUG
>  >
>  > Alternatively, you can use any of " ,;:|" as the separator between
>  > options.
> 
> I think that allowing all these separators may create problems if in 
> future we want to have options that use various types of separators 
> within an option. For example "option=value1,value2", 
> "option_range=low:high" or "option_flags=foo|bar". I would prefer that 
> we choose only one separator. We can print a help message describing the 
> option syntax if there was an error parsing the options.

In our project, I implemented something similar and one of my users
rightfully pointed out that using ';' or '|' as a separator is really a
bad idea from the POV of the shell. i.e., CAIRO_DEBUG=foo;bar requires
quoting to work: CAIRO_DEBUG='foo;bar'. We ended up supporting only the
':' separator to parallel PATH-style variables.

hope this helps,
Mathieu



More information about the cairo mailing list