Esempio n. 1
0
 public LogCreationDatum(System.Diagnostics.SourceLevels sourceLevel,
                         string format,
                         System.Diagnostics.TraceListener listener,
                         params KeyValuePair <string, Udbus.Core.Logging.Formatter.StashDelegate>[] fields)
     : this(sourceLevel, format, new System.Diagnostics.TraceListener[] { listener }, fields)
 {
 }
Esempio n. 2
0
 public DebugListenerBlock()
 {
     if (System.Diagnostics.Debug.Listeners != null && System.Diagnostics.Debug.Listeners.Count > 0)
     {
         _blockedListeners = new System.Diagnostics.TraceListener[System.Diagnostics.Debug.Listeners.Count];
         System.Diagnostics.Debug.Listeners.CopyTo(_blockedListeners, 0);
         System.Diagnostics.Debug.Listeners.Clear();
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the TextFilePointOutput class.
        /// </summary>
        /// <param name="configInfo">Configuration passed from the factory.</param>
        /// <param name="eventType">Runtime event type passed from the factory.</param>
        public TextFilePointOutput(TextFileWriterConfig configInfo, CepEventType eventType)
        {
            // If an empty string as filename was provided, dump output on the console
            this.streamWriter = configInfo.OutputFileName.Length == 0 ?
                                new StreamWriter(Console.OpenStandardOutput()) :
                                new StreamWriter(configInfo.OutputFileName);

            this.delimiter         = configInfo.Delimiter;
            this.bindtimeEventType = eventType;

            this.consoleTracer = new System.Diagnostics.ConsoleTraceListener();
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the TextFilePointOutput class.
        /// </summary>
        /// <param name="configInfo">Configuration passed from the factory.</param>
        /// <param name="eventType">Runtime event type passed from the factory.</param>
        public TextFilePointOutput(TextFileWriterConfig configInfo, CepEventType eventType)
        {
            // If an empty string as filename was provided, dump output on the console
            this.streamWriter = configInfo.OutputFileName.Length == 0 ?
                              new StreamWriter(Console.OpenStandardOutput()) :
                              new StreamWriter(configInfo.OutputFileName);

            this.delimiter = configInfo.Delimiter;
            this.bindtimeEventType = eventType;

            this.consoleTracer = new System.Diagnostics.ConsoleTraceListener();
        }
Esempio n. 5
0
 public TraceListenerPassThru(System.Diagnostics.TraceListener target)
 {
     this.target = target;
     this.Attributes.Clear();
     foreach (System.Collections.DictionaryEntry attribEntry in this.target.Attributes)
     {
         this.Attributes.Add(attribEntry.Key as string, attribEntry.Value as string);
     }
     this.Filter             = target.Filter;
     this.IndentLevel        = target.IndentLevel;
     this.IndentSize         = target.IndentSize;
     this.Name               = target.Name;
     this.TraceOutputOptions = target.TraceOutputOptions;
 }
Esempio n. 6
0
        /// <summary>
        /// Initializes a new instance of the TextFilePointInput class.
        /// </summary>
        /// <param name="configInfo">Configuration structure provided by the Factory. If
        /// the InputFieldOrders member is null, the default mapping will be applied.</param>
        /// <param name="eventType">Represents the actual event type that will be passed into this
        /// constructor from the query binding via the adapter factory class.</param>
        public TextFilePointInput(TextFileReaderConfig configInfo, CepEventType eventType)
        {
            this.streamReader = new StreamReader(configInfo.InputFileName);
            this.cultureInfo  = new CultureInfo(configInfo.CultureName);
            this.delimiter    = configInfo.Delimiter;

            this.bindtimeEventType = eventType;

            // Check whether all fields are contained in the config's field-to-column mapping.
            if (configInfo.InputFieldOrders != null && configInfo.InputFieldOrders.Count != eventType.Fields.Count)
            {
                throw new ArgumentException(
                          string.Format(
                              CultureInfo.InvariantCulture,
                              "The configuration element InputFieldOrders should have {0} elements, but it has {1} elements",
                              eventType.Fields.Count,
                              configInfo.InputFieldOrders.Count));
            }

            // Create mapping from input file field ordinal to engine type field ordinal
            // (the engine orders the members of the type's struct or class lexicographically)
            this.inputOrdinalToCepOrdinal = new Dictionary <int, int>();

            for (int i = 0; i < eventType.Fields.Count; i++)
            {
                if (configInfo.InputFieldOrders != null)
                {
                    CepEventTypeField engineField;

                    if (!eventType.Fields.TryGetValue(configInfo.InputFieldOrders[i], out engineField))
                    {
                        throw new ArgumentException(
                                  string.Format(
                                      CultureInfo.InvariantCulture,
                                      "Event type {0} doesn't have an input field named '{1}'",
                                      eventType.ShortName,
                                      configInfo.InputFieldOrders[i]));
                    }

                    this.inputOrdinalToCepOrdinal.Add(i, engineField.Ordinal);
                }
                else
                {
                    // Use default mapping: lexicographic ordering.
                    this.inputOrdinalToCepOrdinal.Add(i, i);
                }
            }

            this.consoleTracer = new System.Diagnostics.ConsoleTraceListener();
        }
Esempio n. 7
0
 public static Microsoft.Extensions.Logging.ILoggingBuilder AddTraceSource(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Diagnostics.SourceSwitch sourceSwitch, System.Diagnostics.TraceListener listener) => throw null;
 public void Remove(System.Diagnostics.TraceListener listener)
 {
 }
 public int IndexOf(System.Diagnostics.TraceListener listener)
 {
     throw null;
 }
 public bool Contains(System.Diagnostics.TraceListener listener)
 {
     throw null;
 }
 public void Insert(int index, System.Diagnostics.TraceListener listener)
 {
 }
Esempio n. 12
0
 public static Microsoft.Extensions.Logging.ILoggingBuilder AddTraceSource(this Microsoft.Extensions.Logging.ILoggingBuilder builder, string switchName, System.Diagnostics.TraceListener listener)
 {
     throw null;
 }
 public int IndexOf(System.Diagnostics.TraceListener listener)
 {
     return(default(int));
 }
 public bool Contains(System.Diagnostics.TraceListener listener)
 {
     return(default(bool));
 }
Esempio n. 15
0
 public void RemoveListener(System.Diagnostics.TraceListener listener)
 {
     listeners.Remove(listener);
 }
Esempio n. 16
0
 public void AddListener(System.Diagnostics.TraceListener listener)
 {
     listeners.Add(listener);
 }
Esempio n. 17
0
 /// <summary> Remove a listener  </summary>
 /// <param name="listener"> Listener to remove. </param>
 public virtual void RemoveListener(System.Diagnostics.TraceListener listener)
 {
     msgStream.RemoveListener(listener);
 }
Esempio n. 18
0
 public TraceSourceLoggerProvider(System.Diagnostics.SourceSwitch rootSourceSwitch, System.Diagnostics.TraceListener rootTraceListener) => throw null;
Esempio n. 19
0
 public TraceListenerFormat(System.Diagnostics.TraceListener target, Formatter formatter)
     : base(target)
 {
     this.Formatter = formatter;
 }
Esempio n. 20
0
        /// <summary>
        /// Initializes a new instance of the TextFileEdgeInput class.
        /// </summary>
        /// <param name="configInfo">Configuration structure provided by the Factory. If
        /// the InputFieldOrders member is null, the default mapping will be applied.</param>
        /// <param name="eventType">Represents the actual event type that will be passed into this
        /// constructor from the query binding via the adapter factory class.</param>
        public TextFileEdgeInput(TextFileReaderConfig configInfo, CepEventType eventType)
        {
            this.streamReader = new StreamReader(configInfo.InputFileName);
            this.cultureInfo = new CultureInfo(configInfo.CultureName);
            this.delimiter = configInfo.Delimiter;

            this.bindtimeEventType = eventType;

            // check whether all fields are contained in the config's field-to-column mapping
            if (configInfo.InputFieldOrders != null && configInfo.InputFieldOrders.Count != eventType.Fields.Count)
            {
                throw new ArgumentException(
                    string.Format(
                        CultureInfo.InvariantCulture,
                        "The configuration element InputFieldOrders should have {0} elements, but it has {1} elements",
                        eventType.Fields.Count,
                        configInfo.InputFieldOrders.Count));
            }

            // Create mapping from input field ordinal to engine field ordinal
            this.inputOrdinalToCepOrdinal = new Dictionary<int, int>();

            for (int i = 0; i < eventType.Fields.Count; i++)
            {
                if (configInfo.InputFieldOrders != null)
                {
                    CepEventTypeField engineField;

                    if (!eventType.Fields.TryGetValue(configInfo.InputFieldOrders[i], out engineField))
                    {
                        throw new ArgumentException(
                            string.Format(
                                CultureInfo.InvariantCulture,
                                "Event type {0} doesn't have an input field named '{1}'",
                                eventType.ShortName,
                                configInfo.InputFieldOrders[i]));
                    }

                    this.inputOrdinalToCepOrdinal.Add(i, engineField.Ordinal);
                }
                else
                {
                    // Use default mapping: lexicographic ordering.
                    this.inputOrdinalToCepOrdinal.Add(i, i);
                }
            }

            this.consoleTracer = new System.Diagnostics.ConsoleTraceListener();
        }
 public int Add(System.Diagnostics.TraceListener listener)
 {
     throw null;
 }
Esempio n. 22
0
 public TraceListenerBare(System.Diagnostics.TraceListener target)
     : base(target)
 {
 }
Esempio n. 23
0
 public TraceListenerPassThru(System.Diagnostics.TraceListener target)
 {
     this.target = target;
     this.Attributes.Clear();
     foreach (System.Collections.DictionaryEntry attribEntry in this.target.Attributes)
     {
         this.Attributes.Add(attribEntry.Key as string, attribEntry.Value as string);
     }
     this.Filter = target.Filter;
     this.IndentLevel = target.IndentLevel;
     this.IndentSize = target.IndentSize;
     this.Name = target.Name;
     this.TraceOutputOptions = target.TraceOutputOptions;
 }
Esempio n. 24
0
 public static TraceListenerFormat Create(System.Diagnostics.TraceListener target, Formatter formatter)
 {
     return(new TraceListenerFormat(target, formatter));
 }