Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 4
0
 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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }