from google.appengine.api import memcache as MC


def logmsg(msg, log_name='default'):
    # TODO Should optimize to avoid memcache's pickling
    # XXX There is an obvious race if we try to store two msgs at the same time
    l = MC.get(log_name, namespace='msg-logs') or []
    l.insert(0, msg)
    MC.set(log_name, l[:64], namespace='msg-logs') # Keep 64 messages

def getmsglog(log_name='default'):
    return MC.get(log_name, namespace='msg-logs')


@@ -42,16 +42,41 @@
  as MC%0D%0A
+from time import gmtime%0D%0A
 %0D%0A%0D%0Adef 
@@ -309,24 +309,91 @@
     
-l.insert(0
+d = %22%25d/%2502d/%2502d %2502d:%2502d%22 %25 (gmtime()%5B:5%5D)%0D%0A    l.insert(0, %22%25s - %25s%22 %25(d
 , msg)
+)
 %0D%0A  
@@ -414,18 +414,19 @@
 ame, l%5B:
-64
+128
 %5D, names

Prepend date/time to log messages, and expand the size of the message log to 128 entries.