示例#1
0
 private bool Trace(PowerShellTraceEvent traceEvent, PowerShellTraceLevel level, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     EventDescriptor eventDescriptor = new EventDescriptor((int) traceEvent, 1, (byte) this._traceChannel, (byte) level, (byte) operationCode, (int) task, (long) this._keywords);
     if (args != null)
     {
         for (int i = 0; i < args.Length; i++)
         {
             if (args[i] == null)
             {
                 args[i] = string.Empty;
             }
         }
     }
     return _provider.WriteEvent(ref eventDescriptor, args);
 }
 /// <summary>
 /// TraceCritical
 /// </summary>
 public override bool TraceCritical(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return(Trace(traceEvent, PowerShellTraceLevel.Critical, operationCode, task, args));
 }
 /// <summary>
 /// TraceDebug
 /// </summary>
 public override bool TraceDebug(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     // TODO: There is some error thrown by the custom debug level
     // hence Informational is being used
     return(Trace(traceEvent, PowerShellTraceLevel.Informational, operationCode, task, args));
 }
        private bool Trace(PowerShellTraceEvent traceEvent, PowerShellTraceLevel level, PowerShellTraceOperationCode operationCode,
                           PowerShellTraceTask task, params object[] args)
        {
            EventDescriptor ed = new EventDescriptor((int)traceEvent, 1, (byte)_traceChannel, (byte)level,
                                                     (byte)operationCode, (int)task, (long)_keywords);

            /*
             * Not using locks because the _provider is thread safe itself.
             **/

            if (args != null)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    if (args[i] == null)
                    {
                        args[i] = string.Empty;
                    }
                }
            }

            return(_provider.WriteEvent(ref ed, args));
        }
 /// <summary>
 /// TraceCritical
 /// </summary>
 public virtual bool TraceCritical(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return(true);
 }
示例#6
0
 public virtual bool TraceWarning(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return true;
 }
示例#7
0
 public override bool TraceWarning(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return this.Trace(traceEvent, PowerShellTraceLevel.Warning, operationCode, task, args);
 }
示例#8
0
 public override bool TraceDebug(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return this.Trace(traceEvent, PowerShellTraceLevel.Informational, operationCode, task, args);
 }
示例#9
0
 /// <summary>
 /// TraceCritical
 /// </summary>
 public override bool TraceCritical(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return Trace(traceEvent, PowerShellTraceLevel.Critical, operationCode, task, args);
 }
示例#10
0
 /// <summary>
 /// TraceDebug
 /// </summary>
 public override bool TraceDebug(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     // TODO: There is some error thrown by the custom debug level
     // hence Informational is being used
     return Trace(traceEvent, PowerShellTraceLevel.Informational, operationCode, task, args);
 }
示例#11
0
        private bool Trace(PowerShellTraceEvent traceEvent, PowerShellTraceLevel level, PowerShellTraceOperationCode operationCode,
            PowerShellTraceTask task, params object[] args)
        {
            EventDescriptor ed = new EventDescriptor((int)traceEvent, 1, (byte)_traceChannel, (byte)level,
                                                     (byte)operationCode, (int)task, (long)_keywords);

            /*
             * Not using locks because the _provider is thread safe itself.
             **/

            if (args != null)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    if (args[i] == null)
                    {
                        args[i] = string.Empty;
                    }
                }
            }

            return _provider.WriteEvent(ref ed, args);
        }
 public override bool TraceWarning(PowerShellTraceEvent traceEvent, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
 {
     return(this.Trace(traceEvent, PowerShellTraceLevel.Warning, operationCode, task, args));
 }
        private bool Trace(PowerShellTraceEvent traceEvent, PowerShellTraceLevel level, PowerShellTraceOperationCode operationCode, PowerShellTraceTask task, params object[] args)
        {
            EventDescriptor eventDescriptor = new EventDescriptor((int)traceEvent, 1, (byte)this._traceChannel, (byte)level, (byte)operationCode, (int)task, (long)this._keywords);

            if (args != null)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    if (args[i] == null)
                    {
                        args[i] = string.Empty;
                    }
                }
            }
            return(_provider.WriteEvent(ref eventDescriptor, args));
        }