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:
parent
15f56c9f9c
commit
2c0eb79cd7
@ -32,7 +32,7 @@ PATTERN_XENSTORE_VIFS_IN_VM = '/xapi/%s/private/vif'
|
|||||||
|
|
||||||
LOG_ROOT = '/var/log/os-xenapi'
|
LOG_ROOT = '/var/log/os-xenapi'
|
||||||
DEFAULT_LOG_FILE = 'xenapi.log'
|
DEFAULT_LOG_FILE = 'xenapi.log'
|
||||||
LOG = logging.getLogger('XenAPI_utils')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def exit_with_error(err_msg):
|
def exit_with_error(err_msg):
|
||||||
|
@ -20,7 +20,7 @@ import sys
|
|||||||
from os_xenapi.utils import common_function
|
from os_xenapi.utils import common_function
|
||||||
from os_xenapi.utils import sshclient
|
from os_xenapi.utils import sshclient
|
||||||
|
|
||||||
LOG = logging.getLogger('conntrack_service')
|
LOG = logging.getLogger(__name__)
|
||||||
LOG.setLevel(logging.DEBUG)
|
LOG.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import paramiko
|
|||||||
from os_xenapi.client.exception import OsXenApiException
|
from os_xenapi.client.exception import OsXenApiException
|
||||||
from os_xenapi.client.i18n import _
|
from os_xenapi.client.i18n import _
|
||||||
|
|
||||||
LOG = logging.getLogger('SSHClient')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SshExecCmdFailure(OsXenApiException):
|
class SshExecCmdFailure(OsXenApiException):
|
||||||
|
Loading…
Reference in New Issue
Block a user