Set NFD logging level from GUI
refs: #2913 Change-Id: I4255b0467ef8ee6c4a2803ed078256cac9fbfd9c
This commit is contained in:
1 parent
3b8bc652d4
commit
3a4afb19d5
6 files changed
+20
-2
No files matched your search
+1
-1
@@ -110,7 +110,7 @@ class NdnTopo(Topo):
|
||||
for host in hosts_conf:
|
||||
if host.cpu != None and self.isLimited != True:
|
||||
self.isLimited = True
|
||||
self.addHost(host.name, app=host.app, fib=host.uri_tuples,cpu=host.cpu,cores=host.cores,cache=host.cache)
|
||||
self.addHost(host.name, app=host.app, params=host.uri_tuples, cpu=host.cpu,cores=host.cores,cache=host.cache)
|
||||
|
||||
for link in links_conf:
|
||||
if len(link.linkDict) == 0:
|
||||
|
||||
@@ -245,6 +245,7 @@ class HostDialog(CustomDialog):
|
||||
'hostname':self.hostnameEntry.get(),
|
||||
'startCommand':self.startEntry.get(),
|
||||
'fibEntries':fibEntries,
|
||||
'nfd': self.nfdFrame.getValues(),
|
||||
'nlsr': self.nlsrFrame.getValues()
|
||||
}
|
||||
|
||||
@@ -735,6 +736,10 @@ class MiniEdit( Frame ):
|
||||
template.write('site=' + values['site'] + ' ')
|
||||
template.write('nlsr-log-level=' + values['log-level'] + ' ')
|
||||
template.write('max-faces-per-prefix=' + values['max-faces-per-prefix'] + ' ')
|
||||
if 'nfd' in hOpts:
|
||||
values = hOpts['nfd']
|
||||
|
||||
template.write('nfd-log-level=' + values['log-level'] + ' ')
|
||||
|
||||
template.write('\n')
|
||||
|
||||
@@ -1365,6 +1370,7 @@ class MiniEdit( Frame ):
|
||||
newHostOpts['fibEntries'] = hostBox.result['fibEntries']
|
||||
|
||||
newHostOpts['nlsr'] = hostBox.nlsrFrame.getValues()
|
||||
newHostOpts['nfd'] = hostBox.nfdFrame.getValues()
|
||||
|
||||
self.hostOpts[name] = newHostOpts
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ class confNDNHost():
|
||||
self.name = name
|
||||
self.app = app
|
||||
self.uri_tuples = params
|
||||
self.params = params
|
||||
self.cpu = cpu
|
||||
self.cores = cores
|
||||
self.cache = cache
|
||||
|
||||
@@ -48,6 +48,12 @@ class NfdFrame(GuiFrame):
|
||||
self.logLevel = StringVar(self)
|
||||
self.addDropDown("Log level:", self.logLevel, LOG_LEVELS, LOG_LEVELS[3])
|
||||
|
||||
def getValues(self):
|
||||
return {
|
||||
"log-level": self.logLevel.get()
|
||||
}
|
||||
|
||||
|
||||
class NlsrFrame(GuiFrame):
|
||||
|
||||
HYPERBOLIC_STATES = [
|
||||
|
||||
@@ -10,6 +10,8 @@ class Nfd:
|
||||
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 @@ class Nfd:
|
||||
# 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))
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ log
|
||||
; TRACE ; trace messages (most verbose)
|
||||
; ALL ; all messages
|
||||
|
||||
default_level NONE
|
||||
default_level $LOG_LEVEL
|
||||
|
||||
; You may override default_level by assigning a logging level
|
||||
; to the desired module name. Module names can be found in two ways:
|
||||
|
||||
Reference in new issue
Block a user