コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        internal PowerShellTraceSource(PowerShellTraceTask task, PowerShellTraceKeywords keywords)
        {
            if (IsEtwSupported)
            {
                DebugChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Debug,
                                                           keywords | PowerShellTraceKeywords.UseAlwaysDebug);
                AnalyticChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Analytic,
                                                              keywords | PowerShellTraceKeywords.UseAlwaysAnalytic);
                OperationalChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Operational,
                                                                 keywords | PowerShellTraceKeywords.UseAlwaysOperational);

                this.Task     = task;
                this.Keywords = keywords;
            }
            else
            {
                DebugChannel       = NullWriter.Instance;
                AnalyticChannel    = NullWriter.Instance;
                OperationalChannel = NullWriter.Instance;
            }
        }
コード例 #2
0
ファイル: PowerShellETWTracer.cs プロジェクト: 40a/PowerShell
        /// <summary>
        /// Constructor
        /// </summary>
        internal PowerShellTraceSource(PowerShellTraceTask task, PowerShellTraceKeywords keywords)
        {
            if (IsEtwSupported)
            {
                DebugChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Debug,
                                                           keywords | PowerShellTraceKeywords.UseAlwaysDebug);
                AnalyticChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Analytic,
                                                              keywords | PowerShellTraceKeywords.UseAlwaysAnalytic);
                OperationalChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Operational,
                                                                keywords | PowerShellTraceKeywords.UseAlwaysOperational);

                this.Task = task;
                this.Keywords = keywords;
            }
            else
            {
                DebugChannel = NullWriter.Instance;
                AnalyticChannel = NullWriter.Instance;
                OperationalChannel = NullWriter.Instance;
            }
        }