Skip to content

Commit c8a69db

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

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

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

@@ -327,8 +330,8 @@ def __call__(self, env, start_response):
327330
fail_socktype = self.addr2socktypename(fail_addr)
328331
fail_ip = fail_addr[4][0]
329332
fail_port = fail_addr[4][1]
330-
logging.warning("Exchange with %s:[%s]:%d failed: %s",
331-
fail_socktype, fail_ip, fail_port, e)
333+
logger.warning("Exchange with %s:[%s]:%d failed: %s",
334+
fail_socktype, fail_ip, fail_port, e)
332335
if reply is not None:
333336
break
334337

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)