[Pidgin] #6140: XML logger

Pidgin trac at pidgin.im
Tue Nov 11 23:14:19 EST 2008


#6140: XML logger
-----------------------------------------+----------------------------------
 Reporter:  samuel                       |        Owner:  rlaager  
     Type:  patch                        |       Status:  new      
Milestone:  Patches Needing Improvement  |    Component:  libpurple
  Version:  2.4.2                        |   Resolution:           
 Keywords:  xml logger history           |  
-----------------------------------------+----------------------------------
Changes (by rlaager):

  * owner:  => rlaager
  * milestone:  => Patches Needing Improvement


Comment:

 Keeping the file in-sync can be done as follows: Write the file as normal
 on the first message. Then, on subsequent messages, seek backwards over
 the closing tag and write out the next message and closing tag.

 Also, "write" can be defined here as fwrite() + fflush(), just as in the
 existing code. This is probably "good enough". If you want more
 robustness, use a SAX-style parser rather than a DOM-style, so you get
 partial data back if the end of the file is missing. If you really want
 hardcore interoperability, when you encounter that error, rewrite the file
 with the data you were able to retrieve and the closing tag.

 I'm not opposed to this idea in principle, but the big issue is that XML
 buys us absolutely nothing. You're just going to convert the conversation
 markup into XML and then convert it back in again. You'll write a whole
 bunch of code on both ends, for what? If you're going to define a common
 logging format, then it might have some merit. I would recommend you look
 at this page (as well as Adiums implementation, in case that page is out
 of date): http://trac.adiumx.com/wiki/XMLLogFormat

 If you implemented something compatible with Adium's log format, that
 would be useful for at least some people (and close a feature request I
 saw the other day).

 Also, in case this wasn't already mentioned... Use diff -ur (or manually
 concatenate your diffs) rather than making a .tar file of separate diff
 files.

 For your dates, use the ISO date format. Of course, if you go the Adium-
 compatible route, you'd have to do that anyway.

 If I were you, I'd start this project by generating a few sample Adium
 logs and writing the read-only parser first. That way, if you get that
 done but stop then, you've still got something useful to people.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/6140#comment:7>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list