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; } }
extern public static Status Log4JFilterInitLevelC ( out FilterHandle self, [MarshalAs(UnmanagedType.LPStr)] string min, [MarshalAs(UnmanagedType.LPStr)] string max );
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; } }
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; } }
extern public static Status Log4JFilterInitNot (out FilterHandle self, FilterHandle childFilter);
extern public static void Log4JFilterAnyRemove (FilterHandle self, FilterHandle childFilter);
extern public static Status Log4JFilterAnyAdd(FilterHandle self, FilterHandle childFilter);
extern public static Status Log4JFilterInitAny(out FilterHandle self);
public static extern void Log4JFilterAllAdd(FilterHandle self, FilterHandle childFilter);
extern public static Status Log4JFilterInitMessageFs (out FilterHandle self, [MarshalAs(UnmanagedType.LPArray)] byte[] message, UIntPtr messageSize);
public static extern void Log4JFilterInitTimestamp(out FilterHandle self, Int64 min, Int64 max);
public static extern void Log4JFilterInitMessageNt(out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string message);
public static extern void Log4JFilterInitLoggerNt(out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string logger);
public static extern void Log4JFilterInitLevelC( out FilterHandle self, [MarshalAs (UnmanagedType.LPStr)] string min, [MarshalAs (UnmanagedType.LPStr)] string max );
public static extern void Log4JFilterInitAny(out FilterHandle self);
public static extern bool Log4JFilterApply(FilterHandle self, EventHandle @event);
public static extern void Log4JFilterAnyRemove(FilterHandle self, FilterHandle childFilter);
extern public static void Log4JIteratorInitFilter (out IteratorHandle self, IteratorHandle inner, FilterHandle filter);
extern public static bool Log4JFilterApply(FilterHandle self, EventHandle @event);
public static extern void Log4JFilterInitNot(out FilterHandle self, FilterHandle childFilter);
extern public static Status Log4JFilterInitLoggerFs (out FilterHandle self, [MarshalAs(UnmanagedType.LPArray)] byte[] logger, UIntPtr loggerSize);
extern public static Status Log4JFilterInitTimestamp (out FilterHandle self, Int64 min, Int64 max);
internal FilterBase(FilterHandle impl) { impl_ = impl; }
public static extern void Log4JIteratorInitFilter(out IteratorHandle self, IteratorHandle inner, FilterHandle filter);