Don't add stuff to our internal log buffer if noapi is on.

This commit is contained in:
Aldo Cortesi 2012-07-24 22:30:15 +12:00
parent 11896d2118
commit e9de11f0e3

View File

@ -206,14 +206,15 @@ class Pathod(tcp.TCPServer):
h.finish()
def add_log(self, d):
lock = threading.Lock()
with lock:
d["id"] = self.logid
self.log.insert(0, d)
if len(self.log) > self.LOGBUF:
self.log.pop()
self.logid += 1
return d["id"]
if not self.noapi:
lock = threading.Lock()
with lock:
d["id"] = self.logid
self.log.insert(0, d)
if len(self.log) > self.LOGBUF:
self.log.pop()
self.logid += 1
return d["id"]
def clear_log(self):
lock = threading.Lock()