aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/udev.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-04-19 18:45:29 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:45 -0800
commit285f14392b4494501b462796743e67cc54c4cca8 (patch)
treee680bf89d33f73b58f515bb9558a4c3db6ec07f5 /mpm/python/usrp_mpm/periph_manager/udev.py
parentb05f72f339dcb02cc6efc6f2bc7d92c4476b5cc9 (diff)
downloaduhd-285f14392b4494501b462796743e67cc54c4cca8.tar.gz
uhd-285f14392b4494501b462796743e67cc54c4cca8.tar.bz2
uhd-285f14392b4494501b462796743e67cc54c4cca8.zip
mpm: Moved over to new logging infrastructure
Also currently hardcodes some settings.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/udev.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/udev.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/udev.py b/mpm/python/usrp_mpm/periph_manager/udev.py
index a42c95ef5..73601e85c 100644
--- a/mpm/python/usrp_mpm/periph_manager/udev.py
+++ b/mpm/python/usrp_mpm/periph_manager/udev.py
@@ -17,9 +17,7 @@
import pyudev
import os
-from logging import getLogger
-LOG = getLogger(__name__)
-
+from ..mpmlog import get_logger
def get_eeprom_path(address):
"""
@@ -51,19 +49,20 @@ def get_uio_node(uio_name):
context = pyudev.Context()
paths = [device.sys_path
for device in context.list_devices(subsystem="uio")]
- LOG.debug("get_uio_node")
- LOG.debug("got paths: %s", paths)
+ log = get_logger('get_uio_node')
+ log.debug("get_uio_node")
+ log.debug("got paths: %s", paths)
for path in paths:
with open(os.path.join(path, "maps", "map0", "name"), "r") as uio_file:
name = uio_file.read()
- LOG.debug("uio_node name: %s", name.strip())
+ log.debug("uio_node name: %s", name.strip())
if name.strip() == uio_name:
with open(os.path.join(path, "maps", "map0", "size"), "r") as uio_file:
size = uio_file.read()
- LOG.debug("uio_node size: %s", size.strip())
- LOG.debug("uio_node syspath: %s", path)
+ log.debug("uio_node size: %s", size.strip())
+ log.debug("uio_node syspath: %s", path)
# device = pyudev.Device.from_sys_path(context, path)
- LOG.debug("got udev device")
- LOG.debug("device_node: %s size: %s", "/dev/uio0", size.strip())
+ log.debug("got udev device")
+ log.debug("device_node: %s size: %s", "/dev/uio0", size.strip())
return ("/dev/uio0", int(size.strip()))
return ("", 0)