ivalente / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

Coding practice #210

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is more of a technical comment relating to logging than a bug report.

I see everywhere in the code where log messages are constructed before the 
condition whether to log them is evaluated.
This is frankly a bad practice.

Though a little more tedious, it is preferable to code "if(g_Debug) 
DDbgPrint("XXX")" than to rely on DDbgPrint to check the debug flag.
By the time DDbgPrint is reached, we have already wasted resources constructing 
the log messages including the expense of the method call itself.

I won't go into being picky and request different log levels, but that would 
also be another nice to have for when are more interested in higher severity 
messages.

I will gladly take on the duty of refactoring the code to make this happen. 
However, because the changes are going to be very pervasive, I will need your 
go ahead so that we can coordinate this.

As always, thanks a great deal for this project. :)

Original issue reported on code.google.com by flexr...@gmail.com on 18 Feb 2011 at 11:45