logging: do not reference loggers in arguments and attributes

Remove logger arguments in all functions and logger attributes in all
objects, with the exception of API object logger, which is now deprecated.
Replace affected logger calls with module-level logger calls.

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta authored and Martin Basti committed 2017-07-14 15:55:59 +02:00
1 parent bccb243b05
commit ab9d1e75fc
23 files changed
+325 -265

No files matched your search

+6 -3
View File
@@ -23,6 +23,7 @@ Functionality for Command Line Interface.
from __future__ import print_function
import importlib
import logging
import textwrap
import sys
import getpass
@@ -58,6 +59,8 @@ from ipapython.dnsutil import DNSName
import datetime
logger = logging.getLogger(__name__)
def to_cli(name):
"""
@@ -1351,13 +1354,13 @@ def run(api):
sys.exit(api.Backend.cli.run(argv))
except KeyboardInterrupt:
print('')
api.log.info('operation aborted')
logger.info('operation aborted')
except PublicError as e:
error = e
except Exception as e:
api.log.exception('%s: %s', e.__class__.__name__, str(e))
logger.exception('%s: %s', e.__class__.__name__, str(e))
error = InternalError()
if error is not None:
assert isinstance(error, PublicError)
api.log.error(error.strerror)
logger.error(error.strerror)
sys.exit(error.rval)