Use module name (__name__) for getLogger()

We usually use a period-separated hierarchical module name as
the logger's name. But we have three scripts are using a hardcoded
name. This commit is to change them to use __name__ to make them
consistent with others. By using the period-separated hierarchical
module name, it's easier to know which module generated the log
lines so it's also easier to get the file name.

Change-Id: I373ce9b44caf2b9baffb753e6db7ad8789219f4b
This commit is contained in:
Jianghua Wang 2018-02-22 07:46:03 +00:00
parent 15f56c9f9c
commit 2c0eb79cd7
3 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ PATTERN_XENSTORE_VIFS_IN_VM = '/xapi/%s/private/vif'
LOG_ROOT = '/var/log/os-xenapi'
DEFAULT_LOG_FILE = 'xenapi.log'
LOG = logging.getLogger('XenAPI_utils')
LOG = logging.getLogger(__name__)
def exit_with_error(err_msg):

View File

@ -20,7 +20,7 @@ import sys
from os_xenapi.utils import common_function
from os_xenapi.utils import sshclient
LOG = logging.getLogger('conntrack_service')
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.DEBUG)

View File

@ -20,7 +20,7 @@ import paramiko
from os_xenapi.client.exception import OsXenApiException
from os_xenapi.client.i18n import _
LOG = logging.getLogger('SSHClient')
LOG = logging.getLogger(__name__)
class SshExecCmdFailure(OsXenApiException):