Created
February 21, 2011 21:18
-
-
Save andlju/837723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BrilliantLogger | |
{ | |
... | |
Dictionary<string,string> _selectedCategories; | |
... | |
public void Log(string message, string logCategory) | |
{ | |
if (ShouldLog(logCategory)) | |
{ | |
WriteToLog(message); | |
} | |
} | |
void ShouldLog(string logCategory) | |
{ | |
bool shouldLog = false; | |
foreach(var key in _selectedCategories.Keys) | |
{ | |
if (key == category) | |
shouldLog = true; | |
} | |
return shouldLog; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment