[openstack-dev] oslo_log/oslo_config initialization

Davanum Srinivas davanum at gmail.com
Wed Jan 21 13:25:57 UTC 2015


Qiming,

Nova already uses oslo.config. there's a patch against nova to use
oslo_log. Doug took the effort to do this so we'd not face issues once
we release oslo_log, so yes, they have been tested together. Please
hop onto #openstack-oslo to debug in real time.

[1] https://review.openstack.org/#/c/147635/

On Wed, Jan 21, 2015 at 8:11 AM, Qiming Teng <tengqim at linux.vnet.ibm.com> wrote:
> On Wed, Jan 21, 2015 at 12:27:15PM +0200, Denis Makogon wrote:
>> On Wed, Jan 21, 2015 at 12:16 PM, Qiming Teng <tengqim at linux.vnet.ibm.com>
>> wrote:
>>
>> > Hi,
>> >
>> > In the oslo_log 0.1.0 release, the setup() function demands for a conf
>> > parameter, but I have failed to find any hint about setting this up.
>> >
>> > The problem is cfg.CONF() returns None, so the following code fails:
>> >
>> >   conf = cfg.CONF(name='prog', project='project')
>> >   # conf is always None here, so the following call fails
>> >   log.setup(conf, 'project')
>> >
>> > Another attempt also failed, because it cannot find any options:
>> >
>> >   log.setup(cfg.CONF, 'project')
>> >
>> > Any hint or sample code to setup logging if I'm abandoning the log
>> > module from oslo.incubator?
>> >
>> >
>> You might take a look at
>> https://github.com/openstack/oslo.log/blob/master/oslo_log/_options.py
>> Those options are what oslo_log expects to find in service configuration
>> files.
>
> Okay, my guess is that both oslo_config and oslo_log are trying to
> register_cli_options. I have to create a configuration object for
> oslo_log to work, and it means CLI options are registered once.
> Later on, when I'm calling log.register_options(), it is conflicting
> with previous registration.
>
> So, I'm doubting whether these two packages have been tested together?
>
> Regards,
>   Qiming
>
>> > Regards,
>> >   Qiming
>> >
>> >
>> > __________________________________________________________________________
>> > OpenStack Development Mailing List (not for usage questions)
>> > Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>> >
>>
>>
>> Kind regards,
>> Denis M.
>
>> __________________________________________________________________________
>> OpenStack Development Mailing List (not for usage questions)
>> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



-- 
Davanum Srinivas :: https://twitter.com/dims



More information about the OpenStack-dev mailing list