Hi all,
I've been wanting to get a message handler that'll add a timestamp at the start of each message. I didn't want to re-implement OStreamMessageHandler, so I looked into either subclassing it or wrapping it (in the way that FilteredMessageHandler does)
Subclassing it could have worked, but I'd have had to store my own stream reference, as m_stream in OStreamMessageHandler is private.
Wrapping it is what I ended up trying out, and replacing context with "<timestamp> : <context>", however, this is placed after the level string.
Wrapping it would be my preference, as then I could use it with any other Message Handlers (I could see myself using a CompoundMessageHandler with both an OStreamMessageHandler and maybe my own Qt MessageHandlerWidget).
Any suggestions on this? I'm guessing that the MessageHandler interface is probably well and truly locked down, so adding it in as an option at a lower level wouldn't be feasible, but maybe I'm wrong there...?
Thanks
Hugh Macdonald
nvizible – VISUAL EFFECTS
nvizage – PREVISUALIZATION
www.nvizage.com