]> git.ipfire.org Git - nitsi.git/blobdiff - network.py
Log all messages to a recipe with the name of the corresponding test
[nitsi.git] / network.py
index 0e76274a55d1c5884e25fa789ecd23ca40f96f91..d9d09244a1d70871248412c3f1dc0b17467dd93f 100644 (file)
@@ -1,9 +1,14 @@
 #!/usr/bin/python3
 
+import logging
+import os
+
+logger = logging.getLogger("nitsi.network")
+
 # # A class which define and undefine a virtual network based on an xml file
 class network():
     def __init__(self, libvirt_con, network_xml_file):
-        self.log = log(4)
+        self.log = logger.getChild(os.path.basename(network_xml_file))
         self.con = libvirt_con
         try:
             with open(network_xml_file) as fobj: