Re: Debugging
Chris G <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 12, 2007 at 11:27:27PM -0400, Will Guaraldi wrote: > On 6/11/07, Chris G <[email protected]> wrote: > > What's the easiest way to log things (for debugging purposes) from > > pyblosxom plugins? > > There's a logging system that you should use. There's some > documentation in the writing_plugins chapter of the manual and ... I > think some sample code, too. > > from pyblosxom import tools > > def cb_prepare(args): > ... > logger = tools.getLogger() > logger.info("blah blah blah...") > > try: > ... > except Exception, e: > logger.error(e) > > Does that answer your question? > Yes, mostly. However for "Quick and dirty" testing "print >>sys.stderr, something" is quite satisfactory for my needs (as I've discovered). -- Chris Green ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/