Make logs parsable and usable by a script or poezio itself
The logs format is currently as follow:
DD-MM-YY [hh:mm:ss] nick: message that can be on more than one line DD-MM-YY [hh:mm:ss] nick: next message
The issue with that is you cannot find the end of a message. For example the feature that displays messages from the logs in the begining of the conversation cannot find the correct number of messages, it can only count the number of lines.
I propose the following format
YYYY-MM-DD hh:mm:ss nick:N: message that goes on exactly N lines (1 or more) Here for example N would be 3 YYYY-MM-DD hh:mm:ss nick:N: Now N is one
This is easy to parse, sort per date and time if needed, it uses standard date and time format, and the N value lets us know the number of lines in the message body. It would be easier to get “the last 10 messages” with that size. And we could create a shell or python script that lets you find things easily in poezio’s logs. For example a tool that does “print all messages of SOME_JID that contain SOME_WORD”, or even add a search tab that lets you visualize poezio’s logs and search into them.
- Revision 71b6404b by mathieui on 2013-06-09T01:47:16Z:
Adopt the mcabber log format (Fix #2311)
- Revision 9d5fddf5 by mathieui on 2013-06-09T10:56:51Z:
Use the new format in the roster log too (ref #2311) (and add the pep events and invites to it)
- Revision 6c046fe1 by mathieui on 2013-06-21T22:17:55Z:
Parse the new log format to display it. (ref #2311) Archiving old logs is recommended before running this update, just in case.