Use olso.log directly
As the openstack/common is deprecated, Watcher should use oslo lib directly to run in the openstack env. So there is much work to do with oslo. This patch fixed the log part. Change-Id: I3145a842fe3a22b3d08fec60d180329073edd50f
This commit is contained in:
@@ -22,14 +22,15 @@ import os
|
||||
from wsgiref import simple_server
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from watcher.api import app as api_app
|
||||
from watcher.common.i18n import _
|
||||
from watcher.openstack.common import log as logging
|
||||
from watcher import service
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def main():
|
||||
@@ -41,7 +42,7 @@ def main():
|
||||
host, port = cfg.CONF.api.host, cfg.CONF.api.port
|
||||
srv = simple_server.make_server(host, port, app)
|
||||
|
||||
logging.setup('watcher')
|
||||
logging.setup(CONF, 'watcher')
|
||||
LOG.info(_('Starting server in PID %s') % os.getpid())
|
||||
LOG.debug("Watcher configuration:")
|
||||
cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
|
||||
|
||||
@@ -22,18 +22,19 @@ import os
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from watcher.applier.framework.manager_applier import ApplierManager
|
||||
|
||||
from watcher.openstack.common._i18n import _LI
|
||||
from watcher.openstack.common import log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def main():
|
||||
cfg.CONF(sys.argv[1:], project='watcher')
|
||||
logging.setup('watcher')
|
||||
logging.setup(CONF, 'watcher')
|
||||
|
||||
LOG.info(_LI('Starting server in PID %s') % os.getpid())
|
||||
LOG.debug("Configuration:")
|
||||
|
||||
@@ -22,22 +22,23 @@ import os
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from watcher.decision_engine.framework.manager_decision_engine import \
|
||||
DecisionEngineManager
|
||||
from watcher.openstack.common._i18n import _LI
|
||||
from watcher.openstack.common import log as logging
|
||||
cfg.CONF.import_opt('hostname',
|
||||
'watcher.metrics_engine.framework.'
|
||||
'datasources.influxdb_collector',
|
||||
group='watcher_influxdb_collector')
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def main():
|
||||
cfg.CONF(sys.argv[1:], project='watcher')
|
||||
logging.setup('watcher')
|
||||
logging.setup(CONF, 'watcher')
|
||||
|
||||
LOG.info(_LI('Starting server in PID %s') % os.getpid())
|
||||
LOG.debug("Configuration:")
|
||||
|
||||
Reference in New Issue
Block a user