On Wed, Sep 8, 2010 at 6:53 AM, Marius Gedminas <[email protected]> wrote:
> Oh, I think I know what causes that.  webhelpers.markdown has this at
> top-level scope:
>
>    # Configure debug message logger (the hard way - to support python 2.3)
>    logger = getLogger('MARKDOWN')
>    logger.setLevel(DEBUG) # This is restricted by handlers later
>    console_hndlr = StreamHandler()
>    formatter = Formatter('%(name)s-%(levelname)s: "%(message)s"')
>    console_hndlr.setFormatter(formatter)
>    console_hndlr.setLevel(MESSAGE_THRESHOLD)
>    logger.addHandler(console_hndlr)
>
> which means it reconfigures the logging *on import time*, after Paster had set
> it up.  There's no easy way to override it :(  I would call that a bug.

In this case, you can update the logging configuration in
load_environment(). Just import markdown at the top level so that it's
imported first.

Markdown is in a bind because if the application doesn't configure
logging at all, you'll get an unhelpful "no handlers configured"
message when it tries to log. As the comment says, it's inlining
logging.basicConfig() because that function did not exist in 2.3. I
think the answer is to remove 2.3 support; that's what all the other
cool modules are doing. :)

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to