[cfe-commits] r101587 - /cfe/trunk/utils/CIndex/completion_logger_server.py
Ted Kremenek
kremenek at apple.com
Fri Apr 16 17:21:44 PDT 2010
Author: kremenek
Date: Fri Apr 16 19:21:44 2010
New Revision: 101587
URL: http://llvm.org/viewvc/llvm-project?rev=101587&view=rev
Log:
Log code completion data in json format.
Modified:
cfe/trunk/utils/CIndex/completion_logger_server.py
Modified: cfe/trunk/utils/CIndex/completion_logger_server.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/CIndex/completion_logger_server.py?rev=101587&r1=101586&r2=101587&view=diff
==============================================================================
--- cfe/trunk/utils/CIndex/completion_logger_server.py (original)
+++ cfe/trunk/utils/CIndex/completion_logger_server.py Fri Apr 16 19:21:44 2010
@@ -1,7 +1,8 @@
#!/usr/bin/env python
import sys
from socket import *
-from time import localtime, strftime
+from time import strftime
+import datetime
def main():
if len(sys.argv) < 4:
@@ -28,10 +29,12 @@
if not data:
break
else:
- f.write(strftime("'%a, %d %b %Y %H:%M:%S' ", localtime()))
- f.write("'{0}' ".format(addr[0]))
+ f.write("{ ");
+ f.write("\"time\": \"{0}\"".format(datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')))
+ f.write(", \"sender\": \"{0}\" ".format(addr[0]))
+ f.write(", data: ")
f.write(data)
- f.write('\n')
+ f.write(" }\n")
f.flush()
# Close socket
More information about the cfe-commits
mailing list