mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
committed by
Martin Basti
parent
7a482b7c72
commit
07229c8ff6
@@ -6,6 +6,7 @@ import collections
|
||||
import errno
|
||||
import json
|
||||
import locale
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
|
||||
@@ -14,9 +15,8 @@ from . import schema
|
||||
from ipaclient.plugins.rpcclient import rpcclient
|
||||
from ipalib.constants import USER_CACHE_PATH
|
||||
from ipapython.dnsutil import DNSName
|
||||
from ipapython.ipa_log_manager import log_mgr
|
||||
|
||||
logger = log_mgr.get_logger(__name__)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ServerInfo(collections.MutableMapping):
|
||||
@@ -50,7 +50,7 @@ class ServerInfo(collections.MutableMapping):
|
||||
pass
|
||||
else:
|
||||
# warn that the file is unreadable, probably corrupted
|
||||
logger.warning('Failed to read server info: {}'.format(e))
|
||||
logger.warning('Failed to read server info: %s', e)
|
||||
|
||||
def _write(self):
|
||||
try:
|
||||
@@ -62,7 +62,7 @@ class ServerInfo(collections.MutableMapping):
|
||||
with open(self._path, 'w') as sc:
|
||||
json.dump(self._dict, sc)
|
||||
except EnvironmentError as e:
|
||||
logger.warning('Failed to write server info: {}'.format(e))
|
||||
logger.warning('Failed to write server info: %s', e)
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self._dict[key]
|
||||
|
||||
Reference in New Issue
Block a user