/// <summary> /// Create a new formatter instance to use for this Logger. /// Use the DefaultFormatterClass property. /// Subclasses may wish to override. /// </summary> /// <returns>A new formatter.</returns> protected virtual LogEntryFormatter GetDefaultFormatter() { LogEntryFormatter aFormatter = null; try { aFormatter = (LogEntryFormatter)DefaultFormatterClass.GetConstructor(new Type[0]).Invoke(new Object[0]); } catch (Exception) { aFormatter = new LogEntryStandardFormatter(); } return(aFormatter); }
/// <summary> /// Create a new formatter instance to use for this Logger. /// Use the DefaultFormatterClass property. /// Subclasses may wish to override. /// </summary> /// <returns>A new formatter.</returns> protected virtual LogEntryFormatter GetDefaultFormatter() { LogEntryFormatter aFormatter = null; try { aFormatter = (LogEntryFormatter) DefaultFormatterClass.GetConstructor(new Type[] {typeof(LoggingErrorHandler)}).Invoke(new Object[] { new LoggingErrorHandler(OnLoggingError) }); } catch (Exception ex) { OnLoggingError(this, "Error creating formatter", ex); aFormatter = new LogEntryStandardFormatter(OnLoggingError); } return aFormatter; }