[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSLog and fprintf in base
From: |
Wim Oudshoorn |
Subject: |
Re: NSLog and fprintf in base |
Date: |
Wed, 17 Mar 2004 19:39:57 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (darwin) |
Markus Hitter <address@hidden> writes:
> Am 17.03.2004 um 16:42 schrieb Wim Oudshoorn:
>
>> No, I do not want to replace the function fprintf (stderr,...)
>> But I want to replace all the occurrences in base with a custom logging
>> function.
>
> Why define/invent a new logging system? Isn't it possible to fix
> NSLog() and use it everywhere?
Not really, NSLog has two properties that prevents it of being used
everywhere:
* It takes an NSString as first argument.
* It uses locking to make the output consistent
* It adds a timestamp to the output.
The first one is a problem, it assumes that the NSString class is
working correctly.
This means that in tricky situations, like when loading base,
or when detataching a new thread, you can not really use it.
But I agree, that NSLog should be used when possible.
But as far as I know this is already the case, so we are
talking about only a few occurrences of fprintf.
Wim Oudshoorn.