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:
unknown
2015-11-12 11:45:50 +08:00
committed by wangxiyuan
parent f763d6c608
commit 0c348313a4
41 changed files with 74 additions and 70 deletions

View File

@@ -23,11 +23,12 @@ SHOULD include dedicated exception logging.
"""
from oslo_config import cfg
from oslo_log import log as logging
import six
from watcher.common.i18n import _
from watcher.common.i18n import _LE
from watcher.openstack.common import log as logging
LOG = logging.getLogger(__name__)

View File

@@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo_log import log
from watcher.decision_engine.framework.messaging.events import Events
from watcher.openstack.common import log
LOG = log.getLogger(__name__)

View File

@@ -16,7 +16,7 @@
from oslo_config import cfg
from oslo_log import log
from watcher.common.messaging.events.event_dispatcher import \
EventDispatcher
from watcher.common.messaging.messaging_handler import \
@@ -24,7 +24,6 @@ from watcher.common.messaging.messaging_handler import \
from watcher.common.rpc import RequestContextSerializer
from watcher.objects.base import WatcherObjectSerializer
from watcher.openstack.common import log
LOG = log.getLogger(__name__)
CONF = cfg.CONF

View File

@@ -16,13 +16,13 @@
import eventlet
from oslo_config import cfg
from oslo_log import log
import oslo_messaging as om
from threading import Thread
from watcher.common.messaging.utils.transport_url_builder import \
TransportUrlBuilder
from watcher.common.rpc import JsonPayloadSerializer
from watcher.common.rpc import RequestContextSerializer
from watcher.openstack.common import log
eventlet.monkey_patch()
LOG = log.getLogger(__name__)

View File

@@ -16,10 +16,10 @@
import eventlet
from oslo import messaging
from oslo_log import log
from watcher.common.messaging.utils.observable import \
Observable
from watcher.openstack.common import log
eventlet.monkey_patch()

View File

@@ -14,10 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo_log import log
from watcher.common.messaging.utils.synchronization import \
Synchronization
from watcher.openstack.common import log
LOG = log.getLogger(__name__)

View File

@@ -15,7 +15,7 @@
# limitations under the License.
from oslo_config import cfg
from watcher.openstack.common import log
from oslo_log import log
LOG = log.getLogger(__name__)
CONF = cfg.CONF

View File

@@ -19,6 +19,8 @@ import socket
from oslo import messaging
from oslo_config import cfg
from oslo_log import _options
from oslo_log import log
from oslo_utils import importutils
from watcher.common import config
@@ -27,7 +29,6 @@ from watcher.common.i18n import _LI
from watcher.common import rpc
from watcher.objects import base as objects_base
from watcher.openstack.common import context
from watcher.openstack.common import log
from watcher.openstack.common import service
@@ -115,22 +116,16 @@ class RPCService(service.Service):
signal.signal(signal.SIGUSR1, self._handle_signal)
_DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'qpid.messaging=INFO',
'oslo.messaging=INFO', 'sqlalchemy=WARN',
'keystoneclient=INFO', 'stevedore=INFO',
'eventlet.wsgi.server=WARN', 'iso8601=WARN',
'paramiko=WARN', 'requests=WARN', 'neutronclient=WARN',
'glanceclient=WARN', 'watcher.openstack.common=WARN']
def prepare_service(argv=[]):
config.parse_args(argv)
cfg.set_defaults(log.log_opts,
default_log_levels=['amqp=WARN',
'amqplib=WARN',
'qpid.messaging=INFO',
'oslo.messaging=INFO',
'sqlalchemy=WARN',
'keystoneclient=INFO',
'stevedore=INFO',
'eventlet.wsgi.server=WARN',
'iso8601=WARN',
'paramiko=WARN',
'requests=WARN',
'neutronclient=WARN',
'glanceclient=WARN',
'watcher.openstack.common=WARN',
])
log.setup('watcher')
cfg.set_defaults(_options.log_opts,
default_log_levels=_DEFAULT_LOG_LEVELS)
log.setup(cfg.CONF, 'watcher')

View File

@@ -17,6 +17,7 @@
"""Utilities and helper functions."""
from oslo_config import cfg
from oslo_log import log as logging
import re
import six
@@ -24,7 +25,6 @@ import uuid
from watcher.common.i18n import _LW
from watcher.openstack.common import log as logging
UTILS_OPTS = [
cfg.StrOpt('rootwrap_config',