Example #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;
            }
        }
Example #2
0
 extern public static Status Log4JFilterInitLevelC
 (
     out FilterHandle self,
     [MarshalAs(UnmanagedType.LPStr)]
     string min,
     [MarshalAs(UnmanagedType.LPStr)]
     string max
 );
Example #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;
            }
        }
Example #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;
            }
        }
Example #5
0
 extern public static Status Log4JFilterInitNot
     (out FilterHandle self, FilterHandle childFilter);
Example #6
0
 extern public static void Log4JFilterAnyRemove
     (FilterHandle self, FilterHandle childFilter);
Example #7
0
 extern public static Status Log4JFilterAnyAdd(FilterHandle self, FilterHandle childFilter);
Example #8
0
 extern public static Status Log4JFilterInitAny(out FilterHandle self);
Example #9
0
 public static extern void Log4JFilterAllAdd(FilterHandle self, FilterHandle childFilter);
Example #10
0
 extern public static Status Log4JFilterInitMessageFs
     (out FilterHandle self, [MarshalAs(UnmanagedType.LPArray)] byte[] message, UIntPtr messageSize);
Example #11
0
 public static extern void Log4JFilterInitTimestamp(out FilterHandle self, Int64 min, Int64 max);
Example #12
0
 public static extern void Log4JFilterInitMessageNt(out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string message);
Example #13
0
 public static extern void Log4JFilterInitLoggerNt(out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string logger);
Example #14
0
 public static extern void Log4JFilterInitLevelC(
     out FilterHandle self,
     [MarshalAs (UnmanagedType.LPStr)]
     string min,
     [MarshalAs (UnmanagedType.LPStr)]
     string max
     );
Example #15
0
 public static extern void Log4JFilterInitAny(out FilterHandle self);
Example #16
0
 public static extern bool Log4JFilterApply(FilterHandle self, EventHandle @event);
Example #17
0
 public static extern void Log4JFilterAnyRemove(FilterHandle self, FilterHandle childFilter);
Example #18
0
 extern public static void Log4JIteratorInitFilter
     (out IteratorHandle self, IteratorHandle inner, FilterHandle filter);
Example #19
0
 extern public static bool Log4JFilterApply(FilterHandle self, EventHandle @event);
Example #20
0
 public static extern void Log4JFilterInitNot(out FilterHandle self, FilterHandle childFilter);
Example #21
0
 extern public static Status Log4JFilterInitLoggerFs
     (out FilterHandle self, [MarshalAs(UnmanagedType.LPArray)] byte[] logger, UIntPtr loggerSize);
Example #22
0
 extern public static Status Log4JFilterInitTimestamp
     (out FilterHandle self, Int64 min, Int64 max);
Example #23
0
 internal FilterBase(FilterHandle impl)
 {
     impl_ = impl;
 }
Example #24
0
 public static extern void Log4JIteratorInitFilter(out IteratorHandle self, IteratorHandle inner, FilterHandle filter);