// Constructs a LogSwitch. A LogSwitch is used to categorize log messages.
//
// All switches (except for the global LogSwitch) have a parent LogSwitch.
//
public LogSwitch(String name, String description, LogSwitch parent)
{
if (name != null && name.Length == 0)
{
throw new ArgumentOutOfRangeException(nameof(Name), Environment.GetResourceString("Argument_StringZeroLength"));
}
Contract.EndContractBlock();
if ((name != null) && (parent != null))
{
strName = name;
strDescription = description;
iLevel = LoggingLevels.ErrorLevel;
iOldLevel = iLevel;
ParentSwitch = parent;
Log.m_Hashtable.Add(strName, this);
// Call into the EE to let it know about the creation of
// this switch
Log.AddLogSwitch(this);
}
else
{
throw new ArgumentNullException((name == null ? nameof(name) : nameof(parent)));
}
}