static public void Log(String switchName, String message) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { return; } if (!m_registryChecked) { CheckRegistry(); } try { LogSwitch ls; ls = LogSwitch.GetSwitch(switchName); if (ls != null) { System.Diagnostics.Log.Trace(ls, message); System.Diagnostics.Log.Trace(ls, Environment.NewLine); } } catch { System.Diagnostics.Log.Trace("Exception thrown in logging." + Environment.NewLine); System.Diagnostics.Log.Trace("Switch was: " + ((switchName == null) ? "<null>" : switchName) + Environment.NewLine); System.Diagnostics.Log.Trace("Message was: " + ((message == null) ? "<null>" : message) + Environment.NewLine); } }
public static void Log(string switchName, string message) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { return; } if (!BCLDebug.m_registryChecked) { BCLDebug.CheckRegistry(); } try { LogSwitch @switch = LogSwitch.GetSwitch(switchName); if (@switch == null) { return; } Log.Trace(@switch, message); Log.Trace(@switch, Environment.NewLine); } catch { Log.Trace("Exception thrown in logging." + Environment.NewLine); Log.Trace("Switch was: " + (switchName == null ? "<null>" : switchName) + Environment.NewLine); Log.Trace("Message was: " + (message == null ? "<null>" : message) + Environment.NewLine); } }
private static bool CheckEnabled(string switchName, LogLevel level, out LogSwitch logSwitch) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { logSwitch = null; return(false); } logSwitch = LogSwitch.GetSwitch(switchName); return(logSwitch != null && logSwitch.MinimumLevel <= (LoggingLevels)level); }
private static bool CheckEnabled(String switchName, LogLevel level, out LogSwitch logSwitch) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { logSwitch = null; return(false); } logSwitch = LogSwitch.GetSwitch(switchName); if (logSwitch == null) { return(false); } return((int)logSwitch.MinimumLevel <= (int)level); }
internal static bool CheckEnabled(string switchName) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { return(false); } if (!BCLDebug.m_registryChecked) { BCLDebug.CheckRegistry(); } LogSwitch @switch = LogSwitch.GetSwitch(switchName); return(@switch != null && @switch.MinimumLevel <= LoggingLevels.TraceLevel0); }
internal static bool CheckEnabled(String switchName) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { return(false); } if (!m_registryChecked) { CheckRegistry(); } LogSwitch logSwitch = LogSwitch.GetSwitch(switchName); if (logSwitch == null) { return(false); } return((int)logSwitch.MinimumLevel <= (int)LogLevel.Trace); }
internal static bool CheckEnabled(string switchName) { if (AppDomain.CurrentDomain.IsUnloadingForcedFinalize()) { return(false); } if (!m_registryChecked) { CheckRegistry(); } LogSwitch switch2 = LogSwitch.GetSwitch(switchName); if (switch2 == null) { return(false); } return(switch2.MinimumLevel <= LoggingLevels.TraceLevel0); }