コード例 #1
0
 public static void Error(this IEventRegistry registry, IEventSource source, int errorClass, int errorCode, ErrorLevel level, string message, string stackTrace, string errorSource)
 {
     var errorEvent = new ErrorEvent(source, errorClass, errorCode, message);
     errorEvent.ErrorLevel(level);
     errorEvent.StackTrace(stackTrace);
     errorEvent.ErrorSource(errorSource);
     registry.RegisterEvent(errorEvent);
 }
コード例 #2
0
        public static void Error(this IEventRegistry registry, IEventSource source, Exception ex)
        {
            var errorEvent = new ErrorEvent(source, EventClasses.Runtime, -1, ex.Message);
            errorEvent.ErrorLevel(ErrorLevel.Error);
            errorEvent.StackTrace(ex.StackTrace);
            #if !PCL
            errorEvent.ErrorSource(ex.Source);
            #endif

            registry.RegisterEvent(errorEvent);
        }
コード例 #3
0
ファイル: ErrorException.cs プロジェクト: furesoft/deveeldb
        /// <summary>
        /// Transforms the error to an event to be passed to the diagnostics,
        /// given a source where this was generated.
        /// </summary>
        /// <param name="source">The source of the error.</param>
        /// <returns>
        /// Returns an instance of <see cref="ErrorEvent"/> that encapsulates all the information
        /// about this exception, that can be routed to the diagnostics.
        /// </returns>
        public ErrorEvent AsEvent(IEventSource source)
        {
            var e = new ErrorEvent(source, EventClass, ErrorCode, Message);

            foreach (DictionaryEntry entry in Data) {
                e.SetData(entry.Key.ToString(), entry.Value);
            }

            e.ErrorLevel(ErrorLevel);
            e.StackTrace(StackTrace);
            #if !PCL
            e.ErrorSource(Source);
            #endif

            return e;
        }
コード例 #4
0
 public static void OnError(this IEventSource source, Exception error, int errorCode, ErrorLevel level)
 {
     var errorEvent = new ErrorEvent(error, errorCode, level);
     source.OnEvent(errorEvent);
 }
コード例 #5
0
        /// <summary>
        /// Transforms the error to an event to be passed to the diagnostics,
        /// given a source where this was generated.
        /// </summary>
        /// <param name="source">The source of the error.</param>
        /// <returns>
        /// Returns an instance of <see cref="ErrorEvent"/> that encapsulates all the information
        /// about this exception, that can be routed to the diagnostics.
        /// </returns>
        public ErrorEvent AsEvent(IEventSource source)
        {
            var e = new ErrorEvent(this, ErrorCode, ErrorLevel);

            if (source != null)
                e.EventSource = source;

            return e;
        }
コード例 #6
0
        public static void OnError(this IHasContext obj, Exception error, int errorCode, ErrorLevel level)
        {
            var errorEvent = new ErrorEvent(error, errorCode, level);

            obj.OnEvent(errorEvent);
        }
コード例 #7
0
        public static void OnError(this IEventSource source, Exception error, int errorCode, ErrorLevel level)
        {
            var errorEvent = new ErrorEvent(error, errorCode, level);

            source.OnEvent(errorEvent);
        }
コード例 #8
0
ファイル: LogeventRouter.cs プロジェクト: prepare/deveeldb
 private EventLog CreateEntry(ErrorEvent @event)
 {
     return new EventLog(
         @event.EventClass,
         @event.ErrorCode,
         @event.ErrorSource(),
         GetLogLevel(@event.ErrorLevel()),
         @event.Database(),
         @event.UserName(),
         @event.RemoteAddress(),
         @event.Message,
         null);
 }