Commit c234bcf6 authored by Jeremy Hylton's avatar Jeremy Hylton

Change the log file subsystem label to include the path of the file.

parent cf7b178b
...@@ -188,6 +188,7 @@ class ClientCache: ...@@ -188,6 +188,7 @@ class ClientCache:
self._p = p = [None, None] self._p = p = [None, None]
f[0].write(magic + '\0' * (headersize - len(magic))) f[0].write(magic + '\0' * (headersize - len(magic)))
current = 0 current = 0
self._current = current
if self._ltid: if self._ltid:
ts = "; last txn=%x" % u64(self._ltid) ts = "; last txn=%x" % u64(self._ltid)
...@@ -197,7 +198,6 @@ class ClientCache: ...@@ -197,7 +198,6 @@ class ClientCache:
(self.__class__.__name__, storage, size, current, p[current], (self.__class__.__name__, storage, size, current, p[current],
ts)) ts))
self._current = current
self._setup_trace() self._setup_trace()
def open(self): def open(self):
...@@ -250,6 +250,7 @@ class ClientCache: ...@@ -250,6 +250,7 @@ class ClientCache:
f = self._f[self._current] f = self._f[self._current]
f.seek(4) f.seek(4)
tid = f.read(8) tid = f.read(8)
self.log("reading ltid %r" % tid)
if len(tid) < 8 or tid == '\0\0\0\0\0\0\0\0': if len(tid) < 8 or tid == '\0\0\0\0\0\0\0\0':
return None return None
else: else:
...@@ -755,4 +756,6 @@ class ClientCache: ...@@ -755,4 +756,6 @@ class ClientCache:
% (msg, pos, fileindex)) % (msg, pos, fileindex))
def log(self, msg, level=zLOG.INFO): def log(self, msg, level=zLOG.INFO):
zLOG.LOG("ZEC:%s" % self._storage, level, msg) # XXX Using the path of the current file means the tags
# won't match after a cache flip. But they'll be very similar.
zLOG.LOG("ZEC:%s" % self._p[self._current], level, msg)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment