On Apr 21, 3:44 pm, Steve Romanow <
slestak...@gmail.com> wrote:
> I do have redis on the main system that now hosts the file config.
> The client machines do have 2.7+ so maybe I will leverage that.
>
> Is there any __future__ import for the dict config possible?
>
> On Thu, Apr 21, 2011 at 10:36 AM, slestak <
slestak...@gmail.com> wrote:
> > I am still using 2.6 on my main system with file config. Making plans
> > for the future to use dict config. I would really like to store the
> > application logging config as a network resource so I can adjust both
> > client and server log verbosity with one control.
>
> > I am concerned about network calls inside of tight loops and know I
> > need to lean on caching.
>
> > Any thoughts?
I'm not sure why you'd need __future__ imports - the dictconfig in
logutils is there specifically to allow dictConfig() to be used with
earlier Python versions than 2.7, where dictconfig is included in the
standard library.
As dictConfig accepts a dictionary as input, and doesn't care where
that dictionary comes from, you can use any caching scheme you like.
For example, you could have a JSON or YAML file via a network URL,
cached according to your requirements, and use the file to create the
dictionary passed to dictConfig. There are Python http clients which
understand HTTP caching (e.g. httplib2). You can cache locally, using
e.g. squid/varnish, memcached on the server side - it doesn't matter
to dictConfig.
Regards,
Vinay Sajip