Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-22 Thread Davanum Srinivas
Qiming,

you are reading bits and pieces of my responses.if you checkout the
review guess i give up!

-- dims

On Wed, Jan 21, 2015 at 11:18 PM, Qiming Teng
teng...@linux.vnet.ibm.com wrote:
 On Wed, Jan 21, 2015 at 10:55:37AM -0500, Davanum Srinivas wrote:
 Qiming,

 Guessing you were looking at master. if you checkout the review i
 pointed to, you will see what others on the thread have pointed you
 to:
 https://github.com/openstack/oslo.log/blob/master/doc/source/usage.rst

 We are using register_options and setup. we should be adding
 register_options in the future as need arises.

 In most files listed below, the 'logging' refers to
 nova/openstack/common/log.py instead of oslo_log/log.py.  No project can
 throw away openstack/common/log.py at the moment, because it breaks
 things in many ways.

 dims@dims-mac:~/openstack/nova$ find . -name *.py -exec grep -H
 logging {} \; | grep -e \.setup -e \.register_options -e
 \.set_defaults
 ./nova/cmd/all.py:logging.setup(CONF, nova)
 ./nova/cmd/api.py:logging.setup(CONF, nova)
 ./nova/cmd/api_ec2.py:logging.setup(CONF, nova)
 ./nova/cmd/api_metadata.py:logging.setup(CONF, nova)
 ./nova/cmd/api_os_compute.py:logging.setup(CONF, nova)
 ./nova/cmd/cells.py:logging.setup(CONF, 'nova')
 ./nova/cmd/cert.py:logging.setup(CONF, nova)
 ./nova/cmd/compute.py:logging.setup(CONF, 'nova')
 ./nova/cmd/conductor.py:logging.setup(CONF, nova)
 ./nova/cmd/console.py:logging.setup(CONF, nova)
 ./nova/cmd/consoleauth.py:logging.setup(CONF, nova)
 ./nova/cmd/dhcpbridge.py:logging.setup(CONF, nova)
 ./nova/cmd/manage.py:logging.setup(CONF, nova)
 ./nova/cmd/network.py:logging.setup(CONF, nova)
 ./nova/cmd/novncproxy.py:logging.setup(CONF, nova)
 ./nova/cmd/novncproxy.py:logging.setup(CONF, nova)
 ./nova/cmd/objectstore.py:logging.setup(config.CONF, nova)
 ./nova/cmd/scheduler.py:logging.setup(CONF, nova)
 ./nova/cmd/serialproxy.py:logging.setup(CONF, nova)
 ./nova/cmd/spicehtml5proxy.py:logging.setup(CONF, nova)
 ./nova/cmd/xvpvncproxy.py:logging.setup(config.CONF, nova)
 ./nova/openstack/common/report/guru_meditation_report.py:
 logging.setup(CONF, 'blah')
 ./nova/test.py:logging.register_options(CONF)
 ./nova/test.py:logging.setup(CONF, 'nova')

 If you file a review with what you have, maybe we can help, again, pop
 onto the #openstack-oslo channel to ask

 Okay, will do.  Thanks.

 Regards,
   Qiming

 -- dims

 On Wed, Jan 21, 2015 at 10:25 AM, Qiming Teng
 teng...@linux.vnet.ibm.com wrote:
  On Wed, Jan 21, 2015 at 08:25:57AM -0500, Davanum Srinivas wrote:
  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/
 
 
  Well, just checked nova code, it seems openstack.common.log is still
  there. That means there are duplicated code such as the
  'common_cli_opts' which resides in both openstack.common.log and
  oslo_log._options.
 
  I was getting the following error if I'm deleting openstack.common.log
  module:
 
  oslo_config.cfg.NoSuchOptError: no such option: log_config_append
 
  So ... even with oslo_log there, we still need openstack.common.log?
  Pretty confused and a little frustrated after two days of digging.
 
  Regards,
Qiming
 



 __
 OpenStack Development Mailing List (not for usage questions)
 Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



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

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-22 Thread Qiming Teng
On Thu, Jan 22, 2015 at 06:06:54AM -0500, Davanum Srinivas wrote:
 Qiming,
 
 you are reading bits and pieces of my responses.if you checkout the
 review guess i give up!
 
 -- dims

Ah, I see. I jumped directly into the code review dashboard without realizing
that patch is still WIP.  That was my confusion.  Sorry.

Regards,
  Qiming


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Davanum Srinivas
Qiming,

Guessing you were looking at master. if you checkout the review i
pointed to, you will see what others on the thread have pointed you
to:
https://github.com/openstack/oslo.log/blob/master/doc/source/usage.rst

We are using register_options and setup. we should be adding
register_options in the future as need arises.

dims@dims-mac:~/openstack/nova$ find . -name *.py -exec grep -H
logging {} \; | grep -e \.setup -e \.register_options -e
\.set_defaults
./nova/cmd/all.py:logging.setup(CONF, nova)
./nova/cmd/api.py:logging.setup(CONF, nova)
./nova/cmd/api_ec2.py:logging.setup(CONF, nova)
./nova/cmd/api_metadata.py:logging.setup(CONF, nova)
./nova/cmd/api_os_compute.py:logging.setup(CONF, nova)
./nova/cmd/cells.py:logging.setup(CONF, 'nova')
./nova/cmd/cert.py:logging.setup(CONF, nova)
./nova/cmd/compute.py:logging.setup(CONF, 'nova')
./nova/cmd/conductor.py:logging.setup(CONF, nova)
./nova/cmd/console.py:logging.setup(CONF, nova)
./nova/cmd/consoleauth.py:logging.setup(CONF, nova)
./nova/cmd/dhcpbridge.py:logging.setup(CONF, nova)
./nova/cmd/manage.py:logging.setup(CONF, nova)
./nova/cmd/network.py:logging.setup(CONF, nova)
./nova/cmd/novncproxy.py:logging.setup(CONF, nova)
./nova/cmd/novncproxy.py:logging.setup(CONF, nova)
./nova/cmd/objectstore.py:logging.setup(config.CONF, nova)
./nova/cmd/scheduler.py:logging.setup(CONF, nova)
./nova/cmd/serialproxy.py:logging.setup(CONF, nova)
./nova/cmd/spicehtml5proxy.py:logging.setup(CONF, nova)
./nova/cmd/xvpvncproxy.py:logging.setup(config.CONF, nova)
./nova/openstack/common/report/guru_meditation_report.py:
logging.setup(CONF, 'blah')
./nova/test.py:logging.register_options(CONF)
./nova/test.py:logging.setup(CONF, 'nova')

If you file a review with what you have, maybe we can help, again, pop
onto the #openstack-oslo channel to ask

-- dims

On Wed, Jan 21, 2015 at 10:25 AM, Qiming Teng
teng...@linux.vnet.ibm.com wrote:
 On Wed, Jan 21, 2015 at 08:25:57AM -0500, Davanum Srinivas wrote:
 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/


 Well, just checked nova code, it seems openstack.common.log is still
 there. That means there are duplicated code such as the
 'common_cli_opts' which resides in both openstack.common.log and
 oslo_log._options.

 I was getting the following error if I'm deleting openstack.common.log
 module:

 oslo_config.cfg.NoSuchOptError: no such option: log_config_append

 So ... even with oslo_log there, we still need openstack.common.log?
 Pretty confused and a little frustrated after two days of digging.

 Regards,
   Qiming


 __
 OpenStack Development Mailing List (not for usage questions)
 Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



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

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Qiming Teng
On Wed, Jan 21, 2015 at 08:25:57AM -0500, Davanum Srinivas wrote:
 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/
 

Well, just checked nova code, it seems openstack.common.log is still
there. That means there are duplicated code such as the
'common_cli_opts' which resides in both openstack.common.log and
oslo_log._options.

I was getting the following error if I'm deleting openstack.common.log
module:

oslo_config.cfg.NoSuchOptError: no such option: log_config_append

So ... even with oslo_log there, we still need openstack.common.log?
Pretty confused and a little frustrated after two days of digging.

Regards,
  Qiming


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Qiming Teng
On Wed, Jan 21, 2015 at 10:55:37AM -0500, Davanum Srinivas wrote:
 Qiming,
 
 Guessing you were looking at master. if you checkout the review i
 pointed to, you will see what others on the thread have pointed you
 to:
 https://github.com/openstack/oslo.log/blob/master/doc/source/usage.rst
 
 We are using register_options and setup. we should be adding
 register_options in the future as need arises.

In most files listed below, the 'logging' refers to
nova/openstack/common/log.py instead of oslo_log/log.py.  No project can
throw away openstack/common/log.py at the moment, because it breaks
things in many ways.

 dims@dims-mac:~/openstack/nova$ find . -name *.py -exec grep -H
 logging {} \; | grep -e \.setup -e \.register_options -e
 \.set_defaults
 ./nova/cmd/all.py:logging.setup(CONF, nova)
 ./nova/cmd/api.py:logging.setup(CONF, nova)
 ./nova/cmd/api_ec2.py:logging.setup(CONF, nova)
 ./nova/cmd/api_metadata.py:logging.setup(CONF, nova)
 ./nova/cmd/api_os_compute.py:logging.setup(CONF, nova)
 ./nova/cmd/cells.py:logging.setup(CONF, 'nova')
 ./nova/cmd/cert.py:logging.setup(CONF, nova)
 ./nova/cmd/compute.py:logging.setup(CONF, 'nova')
 ./nova/cmd/conductor.py:logging.setup(CONF, nova)
 ./nova/cmd/console.py:logging.setup(CONF, nova)
 ./nova/cmd/consoleauth.py:logging.setup(CONF, nova)
 ./nova/cmd/dhcpbridge.py:logging.setup(CONF, nova)
 ./nova/cmd/manage.py:logging.setup(CONF, nova)
 ./nova/cmd/network.py:logging.setup(CONF, nova)
 ./nova/cmd/novncproxy.py:logging.setup(CONF, nova)
 ./nova/cmd/novncproxy.py:logging.setup(CONF, nova)
 ./nova/cmd/objectstore.py:logging.setup(config.CONF, nova)
 ./nova/cmd/scheduler.py:logging.setup(CONF, nova)
 ./nova/cmd/serialproxy.py:logging.setup(CONF, nova)
 ./nova/cmd/spicehtml5proxy.py:logging.setup(CONF, nova)
 ./nova/cmd/xvpvncproxy.py:logging.setup(config.CONF, nova)
 ./nova/openstack/common/report/guru_meditation_report.py:
 logging.setup(CONF, 'blah')
 ./nova/test.py:logging.register_options(CONF)
 ./nova/test.py:logging.setup(CONF, 'nova')
 
 If you file a review with what you have, maybe we can help, again, pop
 onto the #openstack-oslo channel to ask

Okay, will do.  Thanks.

Regards,
  Qiming

 -- dims
 
 On Wed, Jan 21, 2015 at 10:25 AM, Qiming Teng
 teng...@linux.vnet.ibm.com wrote:
  On Wed, Jan 21, 2015 at 08:25:57AM -0500, Davanum Srinivas wrote:
  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/
 
 
  Well, just checked nova code, it seems openstack.common.log is still
  there. That means there are duplicated code such as the
  'common_cli_opts' which resides in both openstack.common.log and
  oslo_log._options.
 
  I was getting the following error if I'm deleting openstack.common.log
  module:
 
  oslo_config.cfg.NoSuchOptError: no such option: log_config_append
 
  So ... even with oslo_log there, we still need openstack.common.log?
  Pretty confused and a little frustrated after two days of digging.
 
  Regards,
Qiming
 
 


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Qiming Teng
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?

Thanks!

Regards,
  Qiming


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Qiming Teng
On Wed, Jan 21, 2015 at 12:27:15PM +0200, Denis Makogon wrote:
 On Wed, Jan 21, 2015 at 12:16 PM, Qiming Teng teng...@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.

Yes. The configuration file I have them. In the usage.rst file I found
here: https://review.openstack.org/#/c/147312/1/doc/source/usage.rst

The 'changes to app initiliaztion' section is very confusing. I still
need a configuration object, so I did it:

  cfg.CONF(name='prog', project='project')

Then I explicitly register the logging options as suggested:

  log.register_options(cfg.CONF)


Finally, I pass the same object to setup, as suggested:

  log.setup(cfg.CONF, 'prog')

Then I'm getting the following error:

Traceback (most recent call last):
  File /usr/bin/test-engine, line 6, in module
exec(compile(open(__file__).read(), __file__, 'exec'))
  File /opt/stack/proj/bin/test-engine, line 50, in module
log.register_options(cfg.CONF)
  File /usr/lib/python2.6/site-packages/oslo_log/log.py, line 185, in 
register_options
conf.register_cli_opts(_options.common_cli_opts)
  File /usr/lib/python2.6/site-packages/oslo_config/cfg.py, line 1679, in 
__inner
result = f(self, *args, **kwargs)
  File /usr/lib/python2.6/site-packages/oslo_config/cfg.py, line 1860, in 
register_cli_opts
self.register_cli_opt(opt, group, clear_cache=False)
  File /usr/lib/python2.6/site-packages/oslo_config/cfg.py, line 1683, in 
__inner
return f(self, *args, **kwargs)
  File /usr/lib/python2.6/site-packages/oslo_config/cfg.py, line 1852, in 
register_cli_opt
raise ArgsAlreadyParsedError(cannot register CLI option)
oslo_config.cfg.ArgsAlreadyParsedError: arguments already parsed: cannot 
register CLI option

  Thanks!
 
  Regards,
Qiming
 
 
  __
  OpenStack Development Mailing List (not for usage questions)
  Unsubscribe: openstack-dev-requ...@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-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Denis Makogon
On Wed, Jan 21, 2015 at 12:16 PM, Qiming Teng teng...@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.


 Thanks!

 Regards,
   Qiming


 __
 OpenStack Development Mailing List (not for usage questions)
 Unsubscribe: openstack-dev-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Qiming Teng
On Wed, Jan 21, 2015 at 12:27:15PM +0200, Denis Makogon wrote:
 On Wed, Jan 21, 2015 at 12:16 PM, Qiming Teng teng...@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-requ...@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-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Davanum Srinivas
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 teng...@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 teng...@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-requ...@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-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



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

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Mehdi Abaakouk


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi,

Le 2015-01-21 11:16, Qiming Teng a écrit :

Any hint or sample code to setup logging if I'm abandoning the log
module from oslo.incubator?


You need to do:

  cfg.CONF(name='prog', project='project')
  log.setup(cfg.CONF, 'project')

Example of project that already use both: 
https://github.com/stackforge/gnocchi/blob/master/gnocchi/service.py#L25


Cheers,
- ---
Mehdi Abaakouk
mail: sil...@sileht.net
irc: sileht

-BEGIN PGP SIGNATURE-
Version: OpenPGP.js v.1.20131017
Comment: http://openpgpjs.org

wkYEAREIABAFAlS/qU4JEJZbdE7sD8foAAAQQwCfYN9jFNWp4OsxJts7Elmy
8taVKfYAn1uDtfn0aEJVDzXXbLdACzVxXEsB
=lHLc
-END PGP SIGNATURE-


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] oslo_log/oslo_config initialization

2015-01-21 Thread Qiming Teng
On Wed, Jan 21, 2015 at 08:25:57AM -0500, Davanum Srinivas wrote:
 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/

Thanks, glad to know some projects already took the adventure and it
works.

Regards,
  Qiming

 On Wed, Jan 21, 2015 at 8:11 AM, Qiming Teng teng...@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 teng...@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-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev