示例#1
0
        internal override HandleGraph <FilterHandle> Build(Encoding encoding)
        {
            HandleGraph <FilterHandle> child = null;
            FilterHandle primaryFilter       = null;

            // There can be a maximum of 3 exceptions if filter initialization fails:
            // * Initial exception that caused the initialization to fail.
            // * Exception raised when calling primaryFilter.Dispose ().
            // * Exception raised when calling child.Dispose ().
            var cleanupErrors = new List <Exception> (3);

            try
            {
                child = Child.Build(encoding);

                Log4JParserC.Log4JFilterInitNot(out primaryFilter, child.Handle);

                return(HandleGraph.Composite(primaryFilter, child));
            }
            catch (Exception initEx)
            {
                cleanupErrors.Add(initEx);
                Disposable.TryDispose(primaryFilter, cleanupErrors);
                Disposable.TryDispose(child, cleanupErrors);

                if (cleanupErrors.Count > 1)
                {
                    throw new AggregateException(cleanupErrors);
                }

                throw;
            }
        }
示例#2
0
 extern public static Status Log4JFilterInitLevelC
 (
     out FilterHandle self,
     [MarshalAs(UnmanagedType.LPStr)]
     string min,
     [MarshalAs(UnmanagedType.LPStr)]
     string max
 );
示例#3
0
        internal override HandleGraph <FilterHandle> Build(Encoding encoding)
        {
            FilterHandle result = null;

            try
            {
                Log4JParserC.Log4JFilterInitTimestamp(out result, Min, Max);
                return(HandleGraph.Simple(result));
            }
            catch (Exception ex)
            {
                Disposable.DisposeAggregateErrors(result, ex);
                throw;
            }
        }
示例#4
0
        internal override HandleGraph <FilterHandle> Build(Encoding encoding)
        {
            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }

            var logger     = encoding.GetBytes(Logger);
            var loggerSize = new UIntPtr((uint)logger.Length);

            FilterHandle result = null;

            try
            {
                Log4JParserC.Log4JFilterInitLoggerFs(out result, logger, loggerSize);
                return(HandleGraph.Simple(result));
            }
            catch (Exception ex)
            {
                Disposable.DisposeAggregateErrors(result, ex);
                throw;
            }
        }
示例#5
0
 extern public static Status Log4JFilterInitNot
     (out FilterHandle self, FilterHandle childFilter);
示例#6
0
 extern public static void Log4JFilterAnyRemove
     (FilterHandle self, FilterHandle childFilter);
示例#7
0
 extern public static Status Log4JFilterAnyAdd(FilterHandle self, FilterHandle childFilter);
示例#8
0
 extern public static Status Log4JFilterInitAny(out FilterHandle self);
示例#9
0
 public static extern void Log4JFilterAllAdd(FilterHandle self, FilterHandle childFilter);
示例#10
0
 extern public static Status Log4JFilterInitMessageFs
     (out FilterHandle self, [MarshalAs(UnmanagedType.LPArray)] byte[] message, UIntPtr messageSize);
示例#11
0
 public static extern void Log4JFilterInitTimestamp(out FilterHandle self, Int64 min, Int64 max);
示例#12
0
 public static extern void Log4JFilterInitMessageNt(out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string message);
示例#13
0
 public static extern void Log4JFilterInitLoggerNt(out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string logger);
示例#14
0
 public static extern void Log4JFilterInitLevelC(
     out FilterHandle self,
     [MarshalAs (UnmanagedType.LPStr)]
     string min,
     [MarshalAs (UnmanagedType.LPStr)]
     string max
     );
示例#15
0
 public static extern void Log4JFilterInitAny(out FilterHandle self);
示例#16
0
 public static extern bool Log4JFilterApply(FilterHandle self, EventHandle @event);
示例#17
0
 public static extern void Log4JFilterAnyRemove(FilterHandle self, FilterHandle childFilter);
示例#18
0
 extern public static void Log4JIteratorInitFilter
     (out IteratorHandle self, IteratorHandle inner, FilterHandle filter);
示例#19
0
 extern public static bool Log4JFilterApply(FilterHandle self, EventHandle @event);
示例#20
0
 public static extern void Log4JFilterInitNot(out FilterHandle self, FilterHandle childFilter);
示例#21
0
 extern public static Status Log4JFilterInitLoggerFs
     (out FilterHandle self, [MarshalAs(UnmanagedType.LPArray)] byte[] logger, UIntPtr loggerSize);
示例#22
0
 extern public static Status Log4JFilterInitTimestamp
     (out FilterHandle self, Int64 min, Int64 max);
示例#23
0
 internal FilterBase(FilterHandle impl)
 {
     impl_ = impl;
 }
示例#24
0
 public static extern void Log4JIteratorInitFilter(out IteratorHandle self, IteratorHandle inner, FilterHandle filter);