CocoaScript icon indicating copy to clipboard operation
CocoaScript copied to clipboard

Debug controller

Open samdeane opened this issue 11 years ago • 2 comments

Debug output is a bit spammy (although I noticed you've commented out the worst offender recently).

I'm thinking of adding a debugController alongside the printController and errorController, so that we can channel debug output elsewhere. I would then change the debug() macro to send the output through the controller for debug builds, but still do nothing for release builds.

Any thoughts/objections?

samdeane avatar May 24 '14 07:05 samdeane

I like the idea- but I'm not sure it should go through something like debugController - there will be cases where there isn't a controller to print things through (such as the preprocessor).

Instead, they could just be commented out or deleted. For years it's only been me working on the code, so that's what I did :)

Or maybe debug() should be given a level that's passed along with the macro?

ccgus avatar May 24 '14 17:05 ccgus

I did wonder about that after I made the issue - hadn't actually checked to code to see how much of the debug output happened outside the context of a controller.

I would say to integrate ECLogging (but then I would say that wouldn't I). I can see why you wouldn't want to add more dependencies though.

Maybe a global controller, defaulting to one that uses NSLog if it's not set?

[COScript setDebugController:...]

Crude but effective...

samdeane avatar May 26 '14 12:05 samdeane