Skip to content

Commit 75eb76f

Browse files
committed
Use dedicated "kdcproxy" logger
Signed-off-by: Julien Rische <jrische@redhat.com>
1 parent f3de938 commit 75eb76f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

kdcproxy/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
import httplib
3939
import urlparse
4040

41+
logging.basicConfig()
42+
logger = logging.getLogger('kdcproxy')
43+
4144

4245
class HTTPException(Exception):
4346

@@ -325,8 +328,8 @@ def __call__(self, env, start_response):
325328
fail_socktype = self.addr2socktypename(fail_addr)
326329
fail_ip = fail_addr[4][0]
327330
fail_port = fail_addr[4][1]
328-
logging.warning("Exchange with %s:[%s]:%d failed: %s",
329-
fail_socktype, fail_ip, fail_port, e)
331+
logger.warning("Exchange with %s:[%s]:%d failed: %s",
332+
fail_socktype, fail_ip, fail_port, e)
330333
if reply is not None:
331334
break
332335

kdcproxy/config/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
import dns.rdatatype
3333
import dns.resolver
3434

35+
logging.basicConfig()
36+
logger = logging.getLogger('kdcproxy')
37+
3538

3639
class IResolver(object):
3740

@@ -60,14 +63,14 @@ def __init__(self, filenames=None):
6063
try:
6164
self.__cp.read(filenames)
6265
except configparser.Error:
63-
logging.error("Unable to read config file(s): %s", filenames)
66+
logger.error("Unable to read config file(s): %s", filenames)
6467

6568
try:
6669
mod = self.__cp.get(self.GLOBAL, "configs")
6770
try:
6871
importlib.import_module("kdcproxy.config." + mod)
6972
except ImportError as e:
70-
logging.log(logging.ERROR, "Error reading config: %s" % e)
73+
logger.log(logging.ERROR, "Error reading config: %s" % e)
7174
except configparser.Error:
7275
pass
7376

0 commit comments

Comments
 (0)