Set NFD logging level from GUI

refs: #2913

Change-Id: I4255b0467ef8ee6c4a2803ed078256cac9fbfd9c
diff --git a/ndn/nfd.py b/ndn/nfd.py
index 6fea538..817e8d9 100644
--- a/ndn/nfd.py
+++ b/ndn/nfd.py
@@ -10,6 +10,8 @@
         self.node = node
         self.isRunning = False
 
+        self.logLevel = node.params["params"].get("nfd-log-level", "NONE")
+
         # Create home directory for a node
         node.cmd("cd /tmp && mkdir %s" % node.name)
         node.cmd("cd %s" % node.name)
@@ -24,6 +26,9 @@
         # Copy nfd.conf file from /usr/local/etc/mini-ndn to the node's home
         node.cmd("sudo cp /usr/local/etc/mini-ndn/nfd.conf %s" % self.confFile)
 
+        # Set log level
+        node.cmd("sudo sed -i \'s|$LOG_LEVEL|%s|g\' %s" % (self.logLevel, self.confFile))
+
         # Open the conf file and change socket file name
         node.cmd("sudo sed -i 's|nfd.sock|%s.sock|g' %s" % (node.name, self.confFile))