Commit 6149f9d5 authored by Peter V. Saveliev's avatar Peter V. Saveliev

logging: `getLogger()` by module name

Bug-Url: https://github.com/svinota/pyroute2/issues/246
parent 1a1d394b
......@@ -17,7 +17,7 @@ from pyroute2.netlink.exceptions import \
NetlinkDecodeError
logging.basicConfig()
log = logging.getLogger('pyroute2')
log = logging.getLogger(__name__)
# reexport exceptions
exceptions = [NetlinkError,
......
......@@ -403,7 +403,7 @@ from pyroute2.ipdb.exceptions import CreateException
from pyroute2.ipdb.transactional import SYNC_TIMEOUT
logging.basicConfig()
log = logging.getLogger('pyroute2.ipdb.main')
log = logging.getLogger(__name__)
def get_addr_nla(msg):
......
......@@ -20,7 +20,7 @@ from pyroute2.ipdb.transactional import SYNC_TIMEOUT
from pyroute2.ipdb.linkedset import LinkedSet
logging.basicConfig()
log = logging.getLogger('pyroute2.ipdb.route')
log = logging.getLogger(__name__)
class Metrics(Transactional):
......
......@@ -125,7 +125,7 @@ from pyroute2.netlink.exceptions import NetlinkError
DEFAULT_TABLE = 254
logging.basicConfig()
log = logging.getLogger('pyroute2.iproute')
log = logging.getLogger(__name__)
def transform_handle(handle):
......
......@@ -407,7 +407,7 @@ from pyroute2.netlink.exceptions import NetlinkDecodeError
from pyroute2.netlink.exceptions import NetlinkNLADecodeError
logging.basicConfig()
log = logging.getLogger('pyroute2.netlink.parser')
log = logging.getLogger(__name__)
# make pep8 happy
_ne = NetlinkError # reexport for compatibility
_de = NetlinkDecodeError #
......
......@@ -118,7 +118,7 @@ except ImportError:
from queue import Queue
logging.basicConfig()
log = logging.getLogger('pyroute2.netlink.nlsocket')
log = logging.getLogger(__name__)
class Marshal(object):
......
......@@ -10,7 +10,7 @@ from pyroute2.common import basestring
from pyroute2.netlink import nla
logging.basicConfig()
log = logging.getLogger('pyroute2.netlink.rtnl.tcmsg')
log = logging.getLogger(__name__)
LINKLAYER_UNSPEC = 0
LINKLAYER_ETHERNET = 1
......
......@@ -33,7 +33,7 @@ from pyroute2.netlink.rtnl.tcmsg.common import red_eval_idle_damping
from pyroute2.netlink.rtnl.tcmsg.common import stats2 as c_stats2
logging.basicConfig()
log = logging.getLogger('pyroute2.netlink.rtnl.tcmsg')
log = logging.getLogger(__name__)
parent = TC_H_ROOT
......
......@@ -5,7 +5,7 @@ from pyroute2.netlink.rtnl.tcmsg.common import get_time
from pyroute2.netlink.rtnl.tcmsg.common import stats2 as c_stats2
logging.basicConfig()
log = logging.getLogger('pyroute2.netlink.rtnl.tcmsg')
log = logging.getLogger(__name__)
parent = TC_H_ROOT
......
......@@ -6,7 +6,7 @@ from pyroute2.netlink.rtnl.tcmsg import common
from pyroute2.netlink.rtnl.tcmsg.common import get_time
logging.basicConfig()
log = logging.getLogger('pyroute2.netlink.rtnl.tcmsg')
log = logging.getLogger(__name__)
parent = TC_H_ROOT
......
......@@ -79,7 +79,7 @@ from pyroute2.remote import Server
from pyroute2.remote import RemoteSocket
logging.basicConfig()
log = logging.getLogger('pyroute2.netns')
log = logging.getLogger(__name__)
def NetNServer(netns, cmdch, brdch, flags=os.O_CREAT):
......
......@@ -9,7 +9,7 @@ import threading
from pyroute2.netlink.exceptions import NetlinkError
logging.basicConfig()
log = logging.getLogger('pyroute2.proxy')
log = logging.getLogger(__name__)
class NetlinkProxy(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment