I was fiddling with some prototype code today and I needed very simple logging to spot an error. So I threw together this:
private static void WriteLog(string message)
{
StreamWriter sw = new StreamWriter("test.log");
sw.WriteLine(DateTime.Now.ToString("yy-MM-dd HH:mm:ss - " + message));
sw.Close();
}
But the result was not exactly what I expected. My program speaks some kind of l33t!
07-07-04 15:21:31 - Sarup.
07-07-04 15:21:31 - Para21eer31: repo31ior7 = D:.Subver31ion.repo31.DevelopinA.D., revi31ion = 137627, o = 4avi4.vi421ar@a4aca.31i
07-07-04 15:22:06 - Ti22eoue4!
How fast can you spot the bug?
It took me more than a few seconds... But maybe just because this is the coolest log I ever wrote.