示例#1
0
 internal PowerShellTraceSource(PowerShellTraceTask task, PowerShellTraceKeywords keywords)
 {
     if (this.IsEtwSupported)
     {
         this.debugChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Debug, keywords | (PowerShellTraceKeywords.None | PowerShellTraceKeywords.UseAlwaysDebug));
         this.analyticChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Analytic, keywords | (PowerShellTraceKeywords.None | PowerShellTraceKeywords.UseAlwaysAnalytic));
         this.operationsChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Operational, keywords | (PowerShellTraceKeywords.None | PowerShellTraceKeywords.UseAlwaysOperational));
         this.task = task;
         this.keywords = keywords;
     }
     else
     {
         this.debugChannel = NullWriter.Instance;
         this.analyticChannel = NullWriter.Instance;
         this.operationsChannel = NullWriter.Instance;
     }
 }
 internal PowerShellTraceSource(PowerShellTraceTask task, PowerShellTraceKeywords keywords)
 {
     if (this.IsEtwSupported)
     {
         this.debugChannel      = new PowerShellChannelWriter(PowerShellTraceChannel.Debug, keywords | (PowerShellTraceKeywords.None | PowerShellTraceKeywords.UseAlwaysDebug));
         this.analyticChannel   = new PowerShellChannelWriter(PowerShellTraceChannel.Analytic, keywords | (PowerShellTraceKeywords.None | PowerShellTraceKeywords.UseAlwaysAnalytic));
         this.operationsChannel = new PowerShellChannelWriter(PowerShellTraceChannel.Operational, keywords | (PowerShellTraceKeywords.None | PowerShellTraceKeywords.UseAlwaysOperational));
         this.task     = task;
         this.keywords = keywords;
     }
     else
     {
         this.debugChannel      = NullWriter.Instance;
         this.analyticChannel   = NullWriter.Instance;
         this.operationsChannel = NullWriter.Instance;
     }
 }