logging: do not use ipa_log_manager to create module-level loggers

Replace all `ipa_log_manager.log_mgr.get_logger` calls to create
module-level loggers with `logging.getLogger` calls and deprecate
`ipa_log_manager.log_mgr.get_logger`.

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Jan Cholasta
2017-05-25 10:42:54 +00:00
committed by Martin Basti
parent 7a482b7c72
commit 07229c8ff6
14 changed files with 103 additions and 98 deletions

View File

@@ -5,6 +5,7 @@
import collections
import errno
import json
import logging
import os
import sys
import tempfile
@@ -23,7 +24,8 @@ from ipalib.parameters import DefaultFrom, Flag, Password, Str
from ipapython.ipautil import fsdecode
from ipapython.dn import DN
from ipapython.dnsutil import DNSName
from ipapython.ipa_log_manager import log_mgr
logger = logging.getLogger(__name__)
FORMAT = '1'
@@ -57,8 +59,6 @@ _PARAMS = {
'str': parameters.Str,
}
logger = log_mgr.get_logger(__name__)
class _SchemaCommand(ClientCommand):
pass
@@ -377,7 +377,7 @@ class Schema(object):
# Failed to read the schema from cache. There may be a lot of
# causes and not much we can do about it. Just ensure we will
# ignore the cache and fetch the schema from server.
logger.warning("Failed to read schema: {}".format(e))
logger.warning("Failed to read schema: %s", e)
fingerprint = None
read_failed = True
@@ -387,7 +387,7 @@ class Schema(object):
try:
self._write_schema(fingerprint)
except Exception as e:
logger.warning("Failed to write schema: {}".format(e))
logger.warning("Failed to write schema: %s", e)
self.fingerprint = fingerprint
self.ttl = ttl