Huh, that's odd. This code looks a lot like log file formatting. Seems like it's the same question as well. How about if you read the perfectly good replies to that node?
Of course it could just be me. It is Thursday, and I never could quite get the hang of Thursdays.