Beispiel #1
0
        internal static void Initialize()
        {
            // Don't allow failures to propagate upstream.  Ensure program correctness without tracing.
            try
            {
                Initializing = true;

                if (s_controllerInstance == null)
                {
                    int enabled = Config_EnableEventPipe;
                    if (enabled > 0)
                    {
                        // Enable tracing immediately.
                        // It will be disabled automatically on shutdown.
                        EventPipe.Enable(BuildConfigFromEnvironment());
                    }
                    // If not set at all, we listen for changes in the control file.
                    else if (enabled != 0)
                    {
                        // Create a new controller to listen for commands.
                        s_controllerInstance = new EventPipeController();
                    }
                    // If enable is explicitly set to 0, then don't start the controller (to avoid overhead).
                    RuntimeEventSource.Initialize();
                }
            }
            catch { }
            finally
            {
                Initializing = false;
            }
        }
        internal static void Initialize()
        {
            // Don't allow failures to propagate upstream.  Ensure program correctness without tracing.
            try
            {
                s_initializing = true;

                if (s_controllerInstance == null)
                {
                    if (Config_EnableEventPipe > 0)
                    {
                        // Enable tracing immediately.
                        // It will be disabled automatically on shutdown.
                        EventPipe.Enable(BuildConfigFromEnvironment());
                    }
                    else
                    {
                        // Create a new controller to listen for commands.
                        s_controllerInstance = new EventPipeController();
                    }
                }
            }
            catch { }
            finally
            {
                s_initializing = false;
            }
        }
 internal static void Initialize()
 {
     // Don't allow failures to propagate upstream.
     // Instead, ensure program correctness without tracing.
     try
     {
         if (s_controllerInstance == null)
         {
             if (Config_EnableEventPipe == 4)
             {
                 // Create a new controller to listen for commands.
                 s_controllerInstance = new EventPipeController();
             }
             else if (Config_EnableEventPipe > 0)
             {
                 // Enable tracing immediately.
                 // It will be disabled automatically on shutdown.
                 EventPipe.Enable(GetConfiguration());
             }
         }
     }
     catch { }
 }