W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Re: [Re: Tracing enhancements]

From: Mikhail Grouchinski <mgrouch@usa.net>
Date: 18 Feb 99 18:14:16 EST
Message-ID: <19990218231416.25849.qmail@nw177.netaddress.usa.net>
To: www-lib@w3.org
I new two previous variants.

I like the third one

  HTTRACE((type, msg, args));

#ifdef LIBWWW_TRACING
#define HTTRACE(args) HTTrace args
#else
#define HTTRACE(args) if (0); else; 
#endif

void
HTTrace(int type, const char * msg, ...)
{
    if(WWWTRACE & type)  {
        bla bla bla
    }
}

frystyk@w3.org wrote:
At 16:38 2/18/99 EST, Mikhail Grouchinski wrote:
>libwww HTTrace function doesn't print the file name and line.
>This information would be very helpful for debuging.
>I offer the simple solution how to fix this problem.

This is very interesting - what I would love would be to have all the trace
messages be defines so that they can be left out if you want to make a
small application. As there are so many trace messages, they will take up
quite a lot of space.

The way it is often handled is that you have a set of macros

	HTTRACE1(type, msg, arg1)
	HTTRACE2(type, msg, arg1, arg2)
	HTTRACE3(type, msg, arg1, arg2, arg3)

These would then replace

	if (type) HTTrace(msg, arg1...);

that you see all over in the code.

Eric Prud'hommeaux proposed an alternative where we instead have

	HTTRACE(type, msg, arg1_arg1_arg3)

that is, the args are glued together so that the preprocessor doesn't get
confused.

What do you think?

Henrik
--
Henrik Frystyk Nielsen,
World Wide Web Consortium
http://www.w3.org/People/Frystyk


____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1
Received on Thursday, 18 February 1999 18:14:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:28 GMT