gnu3dkit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu3dkit-dev] G3DSphere -wrapPoint: and NSLog usage


From: Philippe C . D . Robert
Subject: Re: [Gnu3dkit-dev] G3DSphere -wrapPoint: and NSLog usage
Date: Tue, 22 Oct 2002 18:00:15 +0200

On Tuesday, October 22, 2002, at 04:55  Uhr, Brent Gulanowski wrote:
On Tuesday, October 22, 2002, at 01:37  AM, Philippe C.D. Robert wrote:

On Monday, October 21, 2002, at 10:38  Uhr, Brent Gulanowski wrote:

This method ends with the following NSLog() call:

NSLog(@"<%@ %x> distance %f > radius %f - ignoring",dist,_radius);

The first two format specifiers appear to have no associated values. Is this meant to preface the output with the class and pointer value? That would require:

NSLog(@"<%@ %x> distance %f > radius %f - ignoring",self, (void *)self, dist,_radius);

however I wanted to clarify the purpose.

Yes, this should be the case ...sigh You see, the ObjC classes in the GK are rarely used and test cases are not really available...:-(

If you find such issues by writing little test apps, please sed them to me or submit them directly (into the Testing dir)!

So far I'm just reading the code, looking for any discrepancies and studying the algorithms. I am working on some ideas for application-level classes that will take primitive descriptions and generate tessellated meshes, as I"ve previously described. Unfortunately this means I have to catch up on a lot of geometry knowledge I've missed over the years.

Sounds interesting, keep on working on that, it is worth it!

I'd also like to bring up the NSLog() usage guidelines, or lack of them. Shall we reserve them for debug, and create a debug flag to wrap around debug code like logging?

For 0.4 I planned to remove NSLog() calls and introduce a special print command which prints warnings, errors and so on depending on a debug level which can be specified via the shell. What do you think?

I like that approach. The standard approach is to use macros, and when not in debug mode define them to nothing.

I know...:-) In the RenderKit I used sth like this:

#ifdef DEBUG
#define DLOG(format, args...) do { NSLog(format, ## args); } while (0)
#else
#define DLOG(format, args...)
#endif DEBUG

I recommend a new file for each library which holds the debug macros and functions.

I will probably introduce sth like a G3DLog class which can be used in many ways and maybe use a macro to be able to do nothing in case of production code. I have something lying around here (used for another ObjC project years ago...), I guess I will dig it out again...

-Phil
--
Philippe C.D. Robert
http://www.nice.ch/~phip





reply via email to

[Prev in Thread] Current Thread [Next in Thread]