Skip to content

Instantly share code, notes, and snippets.

@andlju
Created February 21, 2011 21:18
Show Gist options
  • Save andlju/837723 to your computer and use it in GitHub Desktop.
Save andlju/837723 to your computer and use it in GitHub Desktop.
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