From: Yuri T. <yu...@cs...> - 2008-10-06 21:03:28
|
>> its simple. markdown uses the "MARKDOWN" logger, and sends messages out >> using whichever levels it likes; i.e. logger.info(), logger.debug(), etc. >> But it does *not* within markdown.py's module initialization set the actual >> log level or configure any handlers. This is because markdown.py in total >> is not a commandline application, its first and foremost a library > > This is were things seem to fall apart. I agree here, however, > whenever I've suggested changes of this type, I always get a response > from Yuri that indicates he sees markdown first and foremost as a > commandline script and second as a library. Perhaps we've gotten our > wires crossed on this and that's not how he sees it - but I'm pretty > sure he at least leans more in that direction that I do. Correct me if > I'm wrong. Actually, if I personally had to choose between markdown.py as a library and as a command line application, I would probably choose the library. (If you just want a command line tool, you have more alternatives, including Markdown.pl.) However, I've always meant it to work as both, and in this case I don't think we have a conflict between them. As far as command line use goes, we can just configure the logger inside main(). So, the question is: from the point of view of library users, does it make more sense to setup logging levels? Or should we just leave them as undefined? One potential compromise would be to move all logging setup into a function, leaving the library caller an option of calling it: import markdown markdown.setup_logging() - yuri -- http://sputnik.freewisdom.org/ |