Example #1
0
        public static FormattingMethodLoggerFactory Initialize(
            ILoggerAdapterFactory loggerAdapterFactory,
            IIndentationTracker indentationTracker,
            IMethodEventFormatter methodEventFormatter)
        {
            if (loggerAdapterFactory == null)
            {
                throw new ArgumentNullException("loggerAdapterFactory");
            }

            if (indentationTracker == null)
            {
                throw new ArgumentNullException("indentationTracker");
            }

            if (methodEventFormatter == null)
            {
                throw new ArgumentNullException("methodEventFormatter");
            }

            FormattingMethodLoggerFactory factory = new FormattingMethodLoggerFactory(loggerAdapterFactory, indentationTracker, methodEventFormatter);

            Initialize(factory);
            return(factory);
        }
Example #2
0
        public FormattingMethodLogger(
            MethodBase targetMethod,
            MethodLoggingSettings settings,
            ILoggerAdapter adapter,
            IIndentationTracker indentationTracker,
            IMethodEventFormatter formatter)
        {
            if (targetMethod == null)
            {
                throw new ArgumentNullException("targetMethod");
            }

            if (adapter == null)
            {
                throw new ArgumentNullException("adapter");
            }

            if (indentationTracker == null)
            {
                throw new ArgumentNullException("indentationTracker");
            }

            if (formatter == null)
            {
                throw new ArgumentNullException("formatter");
            }

            this.targetMethod       = targetMethod;
            this.settings           = settings;
            this.adapter            = adapter;
            this.indentationTracker = indentationTracker;
            this.formatter          = formatter;
        }
 public static int GetVirtualIndentationColumn(this IIndentationTracker thisObject, DocumentLocation loc)
 {
     return(thisObject.GetVirtualIndentationColumn(loc.Line, loc.Column));
 }
 public static string GetIndentationString(this IIndentationTracker thisObject, DocumentLocation loc)
 {
     return(thisObject.GetIndentationString(loc.Line, loc.Column));
 }
Example #5
0
        public FormattingMethodLoggerFactory(ILoggerAdapterFactory loggerAdapterFactory, IIndentationTracker indentationTracker, IMethodEventFormatter methodEventFormatter)
        {
            if (loggerAdapterFactory == null)
            {
                throw new ArgumentNullException("loggerAdapterFactory");
            }

            if (indentationTracker == null)
            {
                throw new ArgumentNullException("indentationTracker");
            }

            if (methodEventFormatter == null)
            {
                throw new ArgumentNullException("methodEventFormatter");
            }

            this.LoggerAdapterFactory = loggerAdapterFactory;
            this.IndentationTracker   = indentationTracker;
            this.MethodEventFormatter = methodEventFormatter;
        }