[Adium-devl] "Debug logger" plugin
Peter Hosey
boredzo at gmail.com
Fri Feb 9 21:06:02 UTC 2007
On Feb 09, 2007, at 12:01:38, Evan Schoenberg wrote:
> My objection primarily is that the [string formatting slowdown] is
> present for non-trivial debug messages even if messaging nil... As
> the arguments to [nil printThis:[foo returnAString] andThis:[bar
> returnAnotherString]] are evaluated before the do-nothing of nil
> happens.
Well, yeah, *those* are, but not the string-formatting.
A solution, based loosely on David's solution, would be:
if (globalDebugLogger) {
[globalDebugLogger printThis:[foo returnAString] andThis:[bar
returnAnotherString];
}
globalDebugLogger would be allocked and inited by a class method,
called from -[AIDebugLoggerPlugin initPlugin] (similar to
NSApplication sets NSApp).
The advantages are that it saves both the call to +sharedLogger (its
replacement with a better name would be called only once, by the plug-
in) and any calls that procure the arguments to
totallyMadeUpLogMethod:. It also fills the same purpose as David's
“debug” variable.
And yes, we all hate global variables, but this would be marked
“WARNING WARNING THOU SHALT NOT WRITE HERE” outside of the
AIDebugLogger implementation, as it should be.
___________________________________
\ Peter Hosey / boredzo at adiumx.com
PGP public key ID: C6550423 (since 2007-01-01)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070209/6727cdfb/attachment.sig>
More information about the devel
mailing list