Logging,Agile - Trumpi's blog

Browse by Tags

All Tags » Logging » Agile (RSS)
Sorry, but there are no more tags available to filter with.

What is the fastest, DRYest way to (not) log?

The log4net FAQ asks the question What is the fastest way of (not) logging? It outlines two techniques of logging; I will present one more. The first technique is the slowest of the three, but contains the least amount of code. The following snippet logs a million times and illustrates the first technique: 1: for ( int i = 0; i < 1000000; ++i) 2: { 3: log.Debug( "Number " + i + new Random(DateTime.Now.Millisecond).Next()); 4: } The big disadvantage of this technique is this: If debug...
Posted by trumpi | 4 comment(s)
Filed under: ,