Re: Current Selector
Re: Current Selector
- Subject: Re: Current Selector
- From: Jens Bauer <email@hidden>
- Date: Tue, 7 Jan 2003 23:16:27 +0100
Hi Jake and Ted,
On Tuesday, Jan 7, 2003, at 20:57 Europe/Copenhagen, Jake Repp wrote:
I have the following macros in my current cocoa project:
#define DBG(fmt) printf("[x]: %s:%d: %s: " fmt "\n",
(uint)[NSThread currentThread] , __FILE__, __LINE__,
__PRETTY_FUNCTION__ );
#define DBG1(fmt, a1) printf("[x]: %s:%d: %s: " fmt "\n",
(uint)[NSThread currentThread] , __FILE__ , __LINE__,
__PRETTY_FUNCTION__, a1);
{...snip...}
#define DBG7(fmt, a1,a2,a3,a4,a5,a6,a7) printf("[x]: %s:%d: %s: "
fmt "\n", (uint)[NSThread currentThread] , __FILE__ , __LINE__,
__PRETTY_FUNCTION__, a1,a2,a3,a4,a5,a6,a7);
These can be conditionally compiled out as they add quite a bit of
overhead to the application.
Here's a little goodie...
#define DEBUGMSG(fmt, a...) fprintf(stderr, "%s:%d: " fmt, __FILE__,
__LINE__, a);
...or just...
#define DEBUGMSG(a...) fprintf(stderr, a);
...to make it even simpler.
Mess with it. ;)
Love,
Jens
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.