Trap handlers: log request/reply as info level

Log the basic location-state trap triggering request and command reply
as info level - that way we can receive useful information without
turning on full debug output.

Change-Id: If8eae9f36292930571954becf6613fada43d301c
This commit is contained in:
Max 2018-12-05 17:55:58 +01:00
parent 7f0f786c27
commit 40a375228c
3 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ def comm_proc(comm, bid, f, log):
Command processor: takes function f to run for each command
"""
bsc_id = comm[0].split()[0].split('.')[3] # we expect 1st command to have net.0.bsc.666.bts.2.trx.1 location prefix format
log.debug("BSC %s commands: %r" % (bid, comm))
log.info("BSC %s commands: %r" % (bid, comm))
for t in comm:
(_, m) = Ctrl().cmd(*t.split())
f(m)

View File

@ -104,7 +104,7 @@ class Trap(CTRL):
Handle location-state TRAP: parse trap content, build CGI Request and use treq's routines to post it while setting up async handlers
"""
params = make_params(bsc, data)
self.factory.log.debug('location-state@%s.%s.%s.%s (%s) => %s' % (net, bsc, bts, trx, params['time_stamp'], data))
self.factory.log.info('location-state@%s.%s.%s.%s (%s) => %s' % (net, bsc, bts, trx, params['time_stamp'], data))
params['h'] = gen_hash(params, self.factory.secret_key)
# Ensure that we run only limited number of requests in parallel:
self.factory.semaphore.run(make_async_req, self.factory.location, params, self.transport.write, self.factory.log)

View File

@ -86,7 +86,7 @@ class Trap(CTRL):
Handle location-state TRAP: parse trap content, build SOAP context and use treq's routines to post it while setting up async handlers
"""
params = make_params(bsc, data)
self.factory.log.debug('location-state@%s.%s.%s.%s (%s) => %s' % (net, bsc, bts, trx, params['time_stamp'], data))
self.factory.log.info('location-state@%s.%s.%s.%s (%s) => %s' % (net, bsc, bts, trx, params['time_stamp'], data))
ctx = self.factory.client.registerSiteLocation(bsc, float(params['lon']), float(params['lat']), params['position_validity'], params['time_stamp'], params['oper_status'], params['admin_status'], params['policy_status'])
d = post(self.factory.location, ctx.envelope)
d.addCallback(collect, partial(handle_reply, ctx.process_reply, params['bsc_id'], self.transport.write, self.factory.log)) # treq's collect helper is handy to get all reply content at once using closure on ctx