From 7379144a1292b5fbdcfb4b3ed574ba3095992569 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 4 Aug 2019 17:07:49 +0100 Subject: [PATCH] Stop using mitogen root logger in more modules, remove unused loggers --- mitogen/fork.py | 2 +- mitogen/jail.py | 5 ----- mitogen/kubectl.py | 5 ----- mitogen/lxc.py | 5 ----- mitogen/lxd.py | 5 ----- mitogen/ssh.py | 2 +- mitogen/su.py | 2 +- mitogen/utils.py | 1 - 8 files changed, 3 insertions(+), 24 deletions(-) diff --git a/mitogen/fork.py b/mitogen/fork.py index ee990262..25d1b5a6 100644 --- a/mitogen/fork.py +++ b/mitogen/fork.py @@ -41,7 +41,7 @@ import mitogen.parent from mitogen.core import b -LOG = logging.getLogger('mitogen') +LOG = logging.getLogger(__name__) # Python 2.4/2.5 cannot support fork+threads whatsoever, it doesn't even fix up # interpreter state. So 2.4/2.5 interpreters start .local() contexts for diff --git a/mitogen/jail.py b/mitogen/jail.py index c7c1f0f9..4da7eb0d 100644 --- a/mitogen/jail.py +++ b/mitogen/jail.py @@ -28,15 +28,10 @@ # !mitogen: minify_safe -import logging - import mitogen.core import mitogen.parent -LOG = logging.getLogger(__name__) - - class Options(mitogen.parent.Options): container = None username = None diff --git a/mitogen/kubectl.py b/mitogen/kubectl.py index acc011b9..374ab747 100644 --- a/mitogen/kubectl.py +++ b/mitogen/kubectl.py @@ -28,15 +28,10 @@ # !mitogen: minify_safe -import logging - import mitogen.core import mitogen.parent -LOG = logging.getLogger(__name__) - - class Options(mitogen.parent.Options): pod = None kubectl_path = 'kubectl' diff --git a/mitogen/lxc.py b/mitogen/lxc.py index 759475c1..a86ce5f0 100644 --- a/mitogen/lxc.py +++ b/mitogen/lxc.py @@ -28,15 +28,10 @@ # !mitogen: minify_safe -import logging - import mitogen.core import mitogen.parent -LOG = logging.getLogger(__name__) - - class Options(mitogen.parent.Options): container = None lxc_attach_path = 'lxc-attach' diff --git a/mitogen/lxd.py b/mitogen/lxd.py index 6fbe0694..675dddcd 100644 --- a/mitogen/lxd.py +++ b/mitogen/lxd.py @@ -28,15 +28,10 @@ # !mitogen: minify_safe -import logging - import mitogen.core import mitogen.parent -LOG = logging.getLogger(__name__) - - class Options(mitogen.parent.Options): container = None lxc_path = 'lxc' diff --git a/mitogen/ssh.py b/mitogen/ssh.py index b3fb7bac..b276dd28 100644 --- a/mitogen/ssh.py +++ b/mitogen/ssh.py @@ -49,7 +49,7 @@ except NameError: from mitogen.core import any -LOG = logging.getLogger('mitogen') +LOG = logging.getLogger(__name__) auth_incorrect_msg = 'SSH authentication is incorrect' password_incorrect_msg = 'SSH password is incorrect' diff --git a/mitogen/su.py b/mitogen/su.py index 9813632a..080c9782 100644 --- a/mitogen/su.py +++ b/mitogen/su.py @@ -81,7 +81,7 @@ class SetupBootstrapProtocol(mitogen.parent.BootstrapProtocol): def _on_password_prompt(self, line, match): LOG.debug('%r: (password prompt): %r', - self.stream.name, line.decode('utf-8', 'replace')) + self.stream.name, line.decode('utf-8', 'replace')) if self.stream.conn.options.password is None: self.stream.conn._fail_connection( diff --git a/mitogen/utils.py b/mitogen/utils.py index 94a171fb..b1347d02 100644 --- a/mitogen/utils.py +++ b/mitogen/utils.py @@ -39,7 +39,6 @@ import mitogen.master import mitogen.parent -LOG = logging.getLogger('mitogen') iteritems = getattr(dict, 'iteritems', dict.items) if mitogen.core.PY3: