Angus Salkeld wrote :
> On Mon, 2010-03-29 at 11:10 +0200, Jerome Flesch wrote:
>> Hello,
>>
> [snip]
>> Is there a more adequate way of getting debug information from the 
>> libraries themselves ?
>>
>> I was thinking of a slightly more elegant way of doing it. I could add 
>> functions like for example: 'void coroipcc_set_lasterror(const char 
>> *str)', 'const char *coroipcc_get_lasterror(void)' ? Using 
>> pthread_setspecific(), it would be possible to make it thread-safe. Do 
>> you think it would be worth I spend some time on making a patch for that ?
>>
> Hi
> 
> Thats a good idea, I also like what libevent does:
> http://www.wangafu.net/~nickm/libevent-book/Ref1_libsetup.html
> 
> They give you a way to define a log function, if set, the library calls
> your log function.
> 
I like this idea because the implementation would be simpler (and 
simpler implementation usually mean fewer bugs :). However, if the user 
uses a very slow callback, depending of where are placed the logging 
calls in the library, could it have side effects other than slowing down 
their program ?


> I suppose there are people that REALLY like to be in control of their
> logs and would not want that (they would prefer your idea) and those
> that just want lots of info to debug their code.
> 
> Perhaps we could do both and be flexible.
> 
IMHO, providing both would make the API more confusing than helpful. I 
think we should choose one and stick to it. However, both are equally 
fine to me.
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to