fix log configurition

Change-Id: I3f072f94a7818518fe9bc4f2ff6a774e877261f2
This commit is contained in:
suhaiming 2020-12-25 07:39:57 +00:00
parent 83cc532b25
commit 5c82831587
25 changed files with 21 additions and 88 deletions

View File

@ -16,19 +16,18 @@ import os
import re import re
import enum import enum
from oslo_log import log as logging
from six.moves import urllib from six.moves import urllib
import webob import webob
from venus.api.openstack import wsgi from venus.api.openstack import wsgi
from venus.api import xmlutil from venus.api import xmlutil
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus.i18n import _ from venus.i18n import _
from venus import utils from venus import utils
LOG = logging.getLogger(__name__)
XML_NS_V1 = 'https://www.openstack.org/mediawiki/Venus/1.0/content' XML_NS_V1 = 'https://www.openstack.org/mediawiki/Venus/1.0/content'
METADATA_TYPES = enum.Enum('METADATA_TYPES', 'user image') METADATA_TYPES = enum.Enum('METADATA_TYPES', 'user image')

View File

@ -18,15 +18,11 @@ It can't be called 'extensions' because that causes namespacing problems.
""" """
from oslo_log import log as logging
from venus.api import extensions from venus.api import extensions
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
LOG = logging.getLogger(__name__)
def standard_extensions(ext_mgr): def standard_extensions(ext_mgr):
extensions.load_standard_extensions(ext_mgr, LOG, __path__, __package__) extensions.load_standard_extensions(ext_mgr, LOG, __path__, __package__)

View File

@ -13,21 +13,18 @@
# under the License. # under the License.
import os import os
from oslo_log import log as logging
from oslo_utils import importutils from oslo_utils import importutils
import webob.dec import webob.dec
import webob.exc import webob.exc
from venus.api.openstack import wsgi from venus.api.openstack import wsgi
from venus.api import xmlutil from venus.api import xmlutil
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus import exception from venus import exception
from venus.i18n import _LE, _LI, _LW from venus.i18n import _LE, _LI, _LW
LOG = logging.getLogger(__name__)
class ExtensionDescriptor(object): class ExtensionDescriptor(object):
"""Base class that defines the contract for extensions. """Base class that defines the contract for extensions.

View File

@ -20,22 +20,19 @@ Common Auth Middleware.
import os import os
from oslo_log import log as logging
from oslo_middleware import request_id from oslo_middleware import request_id
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import webob.dec import webob.dec
import webob.exc import webob.exc
from venus.api.openstack import wsgi from venus.api.openstack import wsgi
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus import context from venus import context
from venus.i18n import _ from venus.i18n import _
from venus.wsgi import common as base_wsgi from venus.wsgi import common as base_wsgi
LOG = logging.getLogger(__name__)
def pipeline_factory(loader, global_conf, **local_conf): def pipeline_factory(loader, global_conf, **local_conf):
"""A paste pipeline replica that keys off of auth_strategy.""" """A paste pipeline replica that keys off of auth_strategy."""
pipeline = local_conf[CONF.auth_strategy] pipeline = local_conf[CONF.auth_strategy]

View File

@ -13,12 +13,12 @@
# under the License. # under the License.
from http import client from http import client
from oslo_log import log as logging
import webob.dec import webob.dec
import webob.exc import webob.exc
from venus.common.utils import LOG
from venus import exception from venus import exception
from venus.wsgi import common as base_wsgi from venus.wsgi import common as base_wsgi
@ -27,7 +27,6 @@ from oslo_serialization import jsonutils
import functools import functools
LOG = logging.getLogger(__name__)
JSON_ENCODE_CONTENT_TYPES = {'application/json', 'application/json-home'} JSON_ENCODE_CONTENT_TYPES = {'application/json', 'application/json-home'}

View File

@ -12,20 +12,17 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_log import log as logging
import webob.dec import webob.dec
import webob.exc import webob.exc
from venus.api.openstack import wsgi from venus.api.openstack import wsgi
from venus.common.utils import LOG
from venus import exception from venus import exception
from venus.i18n import _, _LI from venus.i18n import _, _LI
from venus import utils from venus import utils
from venus.wsgi import common as base_wsgi from venus.wsgi import common as base_wsgi
LOG = logging.getLogger(__name__)
class FaultWrapper(base_wsgi.Middleware): class FaultWrapper(base_wsgi.Middleware):
"""Calls down the middleware stack, making exceptions into faults.""" """Calls down the middleware stack, making exceptions into faults."""

View File

@ -22,12 +22,11 @@ import webob
from xml.dom import minidom from xml.dom import minidom
from xml.parsers import expat from xml.parsers import expat
from oslo_log import log as logging
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import encodeutils from oslo_utils import encodeutils
from oslo_utils import excutils from oslo_utils import excutils
from venus.common.utils import LOG
from venus import exception from venus import exception
from venus import i18n from venus import i18n
from venus.i18n import _, _LE, _LI from venus.i18n import _, _LE, _LI
@ -38,7 +37,6 @@ from venus.wsgi import common as wsgi
XML_NS_V1 = 'https://www.openstack.org/mediawiki/Venus/1.0/content' XML_NS_V1 = 'https://www.openstack.org/mediawiki/Venus/1.0/content'
XML_NS_ATOM = 'http://www.w3.org/2005/Atom' XML_NS_ATOM = 'http://www.w3.org/2005/Atom'
LOG = logging.getLogger(__name__)
SUPPORTED_CONTENT_TYPES = ( SUPPORTED_CONTENT_TYPES = (
'application/json', 'application/json',

View File

@ -38,8 +38,6 @@ from venus import version
i18n.enable_lazy() i18n.enable_lazy()
LOG = logging.getLogger(__name__)
# Decorators for actions # Decorators for actions
def args(*args, **kwargs): def args(*args, **kwargs):

View File

@ -17,16 +17,13 @@
import copy import copy
from oslo_context import context from oslo_context import context
from oslo_log import log as logging
from oslo_utils import timeutils from oslo_utils import timeutils
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus.i18n import _, _LW from venus.i18n import _, _LW
LOG = logging.getLogger(__name__)
class RequestContext(context.RequestContext): class RequestContext(context.RequestContext):
"""Security context and request information. """Security context and request information.

View File

@ -18,7 +18,6 @@ import sys
import warnings import warnings
from oslo_db import options from oslo_db import options
from oslo_log import log as logging
from venus.conf import CONF from venus.conf import CONF
from venus.db.common import _create_facade_lazily from venus.db.common import _create_facade_lazily
@ -27,7 +26,6 @@ from venus.i18n import _
CONF.import_group("profiler", "venus.service") CONF.import_group("profiler", "venus.service")
log = logging.getLogger(__name__)
options.set_defaults(CONF, connection='sqlite:///$state_path/venus.sqlite') options.set_defaults(CONF, connection='sqlite:///$state_path/venus.sqlite')

View File

@ -22,18 +22,15 @@ SHOULD include dedicated exception logging.
import sys import sys
from oslo_log import log as logging
from oslo_versionedobjects import exception as obj_exc from oslo_versionedobjects import exception as obj_exc
import six import six
import webob.exc import webob.exc
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus.i18n import _, _LE from venus.i18n import _, _LE
LOG = logging.getLogger(__name__)
class ConvertedException(webob.exc.WSGIHTTPException): class ConvertedException(webob.exc.WSGIHTTPException):
def __init__(self, code=500, title="", explanation=""): def __init__(self, code=500, title="", explanation=""):
self.code = code self.code = code

View File

@ -12,11 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_log import log as logging
from venus.modules.custom_config.backends.sql import CustomConfigSql from venus.modules.custom_config.backends.sql import CustomConfigSql
LOG = logging.getLogger(__name__)
class CustomConfigCore(object): class CustomConfigCore(object):
def __init__(self): def __init__(self):

View File

@ -16,14 +16,12 @@
import time import time
from oslo_db import options from oslo_db import options
from oslo_log import log as logging
from venus.conf import CONF from venus.conf import CONF
from venus.db.common import _create_facade_lazily from venus.db.common import _create_facade_lazily
from venus.modules.custom_config.backends import models from venus.modules.custom_config.backends import models
CONF.import_group("profiler", "venus.service") CONF.import_group("profiler", "venus.service")
log = logging.getLogger(__name__)
options.set_defaults(CONF, connection='sqlite:///$state_path/venus.sqlite') options.set_defaults(CONF, connection='sqlite:///$state_path/venus.sqlite')

View File

@ -14,14 +14,9 @@
"""The template api.""" """The template api."""
from oslo_log import log as logging
from venus.api.openstack import wsgi from venus.api.openstack import wsgi
from venus.modules.custom_config.action import CustomConfigCore from venus.modules.custom_config.action import CustomConfigCore
LOG = logging.getLogger(__name__)
class CustomConfigController(wsgi.Controller): class CustomConfigController(wsgi.Controller):
def __init__(self, ext_mgr): def __init__(self, ext_mgr):

View File

@ -16,15 +16,12 @@ import datetime
import json import json
import time import time
from oslo_log import log as logging
from oslo_utils import timeutils from oslo_utils import timeutils
from venus.common import utils from venus.common import utils
from venus.conf import CONF from venus.conf import CONF
from venus.modules.search import es_template from venus.modules.search import es_template
LOG = logging.getLogger(__name__)
class SearchCore(object): class SearchCore(object):
def __init__(self): def __init__(self):
@ -39,7 +36,7 @@ class SearchCore(object):
index_names = [] index_names = []
status, indexes = utils.request_es(url, 'GET') status, indexes = utils.request_es(url, 'GET')
if status != 200: if status != 200:
LOG.error("failed to get all es indexes") utils.LOG.error("failed to get all es indexes")
return "" return ""
indexes_array = json.loads(indexes) indexes_array = json.loads(indexes)
for index in indexes_array: for index in indexes_array:

View File

@ -14,14 +14,10 @@
"""The template api.""" """The template api."""
from oslo_log import log as logging
from venus.api.openstack import wsgi from venus.api.openstack import wsgi
from venus.modules.search.action import SearchCore from venus.modules.search.action import SearchCore
from venus.modules.search.search_lib import ESSearchObj from venus.modules.search.search_lib import ESSearchObj
LOG = logging.getLogger(__name__)
class SearchController(wsgi.Controller): class SearchController(wsgi.Controller):
def __init__(self, ext_mgr): def __init__(self, ext_mgr):

View File

@ -18,12 +18,9 @@ from elasticsearch import Elasticsearch
import re import re
from urllib.parse import urlparse from urllib.parse import urlparse
from oslo_log import log as logging from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
LOG = logging.getLogger(__name__)
class ESSearchObj(object): class ESSearchObj(object):

View File

@ -17,15 +17,14 @@
import contextlib import contextlib
import datetime import datetime
from oslo_log import log as logging
from oslo_versionedobjects import base from oslo_versionedobjects import base
from oslo_versionedobjects import fields from oslo_versionedobjects import fields
from venus.common.utils import LOG
from venus import exception from venus import exception
from venus import objects from venus import objects
LOG = logging.getLogger('object')
remotable = base.remotable remotable = base.remotable
remotable_classmethod = base.remotable_classmethod remotable_classmethod = base.remotable_classmethod
obj_make_list = base.obj_make_list obj_make_list = base.obj_make_list

View File

@ -20,7 +20,6 @@ import os
import random import random
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_log import log as logging
from oslo_service import loopingcall from oslo_service import loopingcall
from oslo_service import service from oslo_service import service
from oslo_utils import importutils from oslo_utils import importutils
@ -28,6 +27,7 @@ import osprofiler.notifier
from osprofiler import profiler from osprofiler import profiler
import osprofiler.web import osprofiler.web
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus import context from venus import context
from venus import exception from venus import exception
@ -37,9 +37,6 @@ from venus.wsgi import common as wsgi_common
from venus.wsgi import eventlet_server as wsgi from venus.wsgi import eventlet_server as wsgi
LOG = logging.getLogger(__name__)
def setup_profiler(binary, host): def setup_profiler(binary, host):
if CONF.profiler.profiler_enabled: if CONF.profiler.profiler_enabled:
LOG.warning( LOG.warning(

View File

@ -13,12 +13,8 @@
# under the License. # under the License.
"""A Timer Task With APScheduler.""" """A Timer Task With APScheduler."""
from oslo_log import log as logging
from venus.task.core import delete_es_index_task from venus.task.core import delete_es_index_task
LOG = logging.getLogger(__name__)
def delete_es_index_job(): def delete_es_index_job():
job = delete_es_index_task.DeleteESIndexTask() job = delete_es_index_task.DeleteESIndexTask()

View File

@ -17,8 +17,8 @@ import socket
import time import time
from oslo_db import options from oslo_db import options
from oslo_log import log as logging
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus.db.common import _create_facade_lazily from venus.db.common import _create_facade_lazily
from venus.i18n import _LE from venus.i18n import _LE
@ -26,7 +26,6 @@ from venus.task.backends import models
# abc # abc
CONF.import_group("profiler", "venus.service") CONF.import_group("profiler", "venus.service")
log = logging.getLogger(__name__)
options.set_defaults(CONF, connection='sqlite:///$state_path/venus.sqlite') options.set_defaults(CONF, connection='sqlite:///$state_path/venus.sqlite')
@ -44,7 +43,7 @@ class TaskSql(object):
tasks = session.query(models.RegitsterTask).filter_by( tasks = session.query(models.RegitsterTask).filter_by(
task_name=t_name).with_lockmode('update').all() task_name=t_name).with_lockmode('update').all()
if len(tasks) != 1: if len(tasks) != 1:
log.error(_LE("unsupported task type:%s, please check it"), LOG.error(_LE("unsupported task type:%s, please check it"),
t_name) t_name)
return False return False

View File

@ -16,11 +16,8 @@ import datetime
import six import six
import time import time
from oslo_log import log as logging
from venus.common import utils from venus.common import utils
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus.modules.custom_config.backends.sql import CustomConfigSql from venus.modules.custom_config.backends.sql import CustomConfigSql
from venus.modules.search.search_lib import ESSearchObj from venus.modules.search.search_lib import ESSearchObj
@ -28,8 +25,6 @@ from venus.i18n import _LE, _LI
from venus.task.backends.sql import TaskSql from venus.task.backends.sql import TaskSql
LOG = logging.getLogger(__name__)
TASK_NAME = "delete_es_index" TASK_NAME = "delete_es_index"

View File

@ -14,10 +14,8 @@
"""A Timer Task With APScheduler.""" """A Timer Task With APScheduler."""
from apscheduler.schedulers.blocking import BlockingScheduler from apscheduler.schedulers.blocking import BlockingScheduler
from oslo_log import log as logging
from venus.task import adapter from venus.task import adapter
LOG = logging.getLogger(__name__)
sched = BlockingScheduler() sched = BlockingScheduler()

View File

@ -20,15 +20,12 @@ import sys
import webob.dec import webob.dec
import webob.exc import webob.exc
from oslo_log import log as logging from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus import exception from venus import exception
from venus.i18n import _, _LE from venus.i18n import _, _LE
from venus import utils from venus import utils
LOG = logging.getLogger(__name__)
class Request(webob.Request): class Request(webob.Request):
pass pass

View File

@ -25,19 +25,18 @@ import time
import eventlet import eventlet
import eventlet.wsgi import eventlet.wsgi
import greenlet import greenlet
from oslo_log import log as logging from oslo_log import log as logging
from oslo_service import service from oslo_service import service
from oslo_utils import excutils from oslo_utils import excutils
from oslo_utils import netutils from oslo_utils import netutils
from venus.common.utils import LOG
from venus.conf import CONF from venus.conf import CONF
from venus import exception from venus import exception
from venus.i18n import _, _LE, _LI from venus.i18n import _, _LE, _LI
LOG = logging.getLogger(__name__)
class Server(service.ServiceBase): class Server(service.ServiceBase):
"""Server class to manage a WSGI server, serving a WSGI application.""" """Server class to manage a WSGI server, serving a WSGI application."""