librelist archives

« back to archive

Logger within Blueprints

Logger within Blueprints

From:
Mitchell Hashimoto
Date:
2012-04-30 @ 05:42
Hello,

What is the preferred way for a blueprint to access the application logger?

Best,
Mitchell

Re: [flask] Logger within Blueprints

From:
Rhys Elsmore
Date:
2012-04-30 @ 05:45
from flask import current_app

within your blueprint methods:
current_app.logger.debug('test')

On Mon, Apr 30, 2012 at 3:42 PM, Mitchell Hashimoto <
mitchell.hashimoto@gmail.com> wrote:

> Hello,
>
> What is the preferred way for a blueprint to access the application logger?
>
> Best,
> Mitchell
>

Re: [flask] Logger within Blueprints

From:
Mitchell Hashimoto
Date:
2012-05-01 @ 04:37
On Sun, Apr 29, 2012 at 10:45 PM, Rhys Elsmore <rhys@elsmore.id.au> wrote:
> from flask import current_app
>
> within your blueprint methods:
> current_app.logger.debug('test')

That was the missing piece. Thanks!

>
>
> On Mon, Apr 30, 2012 at 3:42 PM, Mitchell Hashimoto
> <mitchell.hashimoto@gmail.com> wrote:
>>
>> Hello,
>>
>> What is the preferred way for a blueprint to access the application
>> logger?
>>
>> Best,
>> Mitchell
>
>