Hello list,

Can someone enlighten me on the use of the second parameter of debug(), and first 
parameter of
info(), warning() functions?

I originally thought that it indicates the error level, but after some experiments and 
delving into the code
I see:

void debug(const char *place, int e, const char *fmt, ...)
{
    if (place_should_be_logged(place) && place_is_not_logged(place) == 0) {
    /*
     * Note: giving `place' to FUNCTION_GUTS makes log lines
         * too long and hard to follow. We'll rely on an external
         * list of what places are used instead of reading them
         * from the log file.
     */
        if ((e = thread_to[gwthread_self()])) {
            FUNCTION_GUTS_EXCL(GW_DEBUG, "");
        } else {
            FUNCTION_GUTS(GW_DEBUG, "");
        }
    }
}


The second condition looks very confusing to me:
        if ((e = thread_to[gwthread_self()]))


debug() is normally called as debug("gw", 0, "blablabla"), and this will translate as
        if ((0 = thread_to[gwthread_self()]))
which does not make sense to me..

Or is this a typo?  I mean '=' is supposed to be '=='? :)

        - Rachman


Reply via email to