Re: [pygccxml-development] improving user experience
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-07-17 14:43:02
|
On 7/17/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > >> - Even though there are several logging streams now I think warning > >> message should still be issued using warning() instead of info() (so > >> that I can set up a file handler at the root logger that only writes > >> true warnings). For example, in calldef_t._exportable_impl() the message > >> about the max_arity thing is still written using info(). Roman, do you > >> mind if I change that to warning()? > > > > Please do it. > > Done. Thank you! > Yes, I have updated earlier today. I did see those messages because of > my own modification that prints every _exportable_reason that is not empty. > Now I've seen your __report_warning() method and realized that the > messages actually should already have appeared in the logger. But > because I only saw 5 messages whereas my code from above printed many > more I thought the user has to call something like readme() himself. > The problem is in __report_warning() which I'd say has a bug. The method > has the following lines right at the beginning: > > if reason in decl_wrapper_t.ALREADY_REPORTED_MSGS: > return > decl_wrapper_t.ALREADY_REPORTED_MSGS.add( reason ) > > But the string "reason" only contains the "raw" message and doesn't > contain anything that is unique to the current declaration. This means > if there is another declaration that cannot be exported for the same > reason, then the warning message for the second declaration will be > suppressed (even though this is a new message as it refers to a > different declaration). Good catch, I did not think about this at all. > So instead of storing "reason" in ALREADY_REPORTED_MSGS this should > rather be "msg" (which contains the declaration string). Or maybe it > would be more efficient if only a reference to the declaration is stored > instead of an entire string Yes. It will be enough. >(or can a declaration have more than one "reason" messages?). Yes and no. Yes - one function could have many problems. No - actually any message indicates that this declaration has some "fatal" error. Also I completely forgot about "readme" functionality. May be my approach is wrong. May be I need to change the code. I think, that instead of reporting warning from "ignore" property, I need to report it from module_creator/creator.py file. What do you think? If you think, that this approach is better and you have time to implement it, please implement it. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |