Does this get unit tested anywhere? It would be good to have tests that log events to a file and read them back and make sure everything gets serialized correctly (actually both logging to a file and just a simpler one that serializes/deserializes). If you wrote test code to generate randomized events that could be useful to contribute here.