Exemple #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);
        }
Exemple #2
0
        public static FormattingMethodLoggerFactory Initialize(
            ILoggerAdapterFactory loggerAdapterFactory,
            IFormatProvider formatProvider,
            ICustomValueFormatter customValueFormatter = null)
        {
            if (loggerAdapterFactory == null)
            {
                throw new ArgumentNullException("loggerAdapterFactory");
            }

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

            IFormattingModeReader formattingModeReader = new CachedFormattingModeReader(new FormattingModeReader());
            IMethodEventFormatter methodEventFormatter = new MethodEventFormatter(new ParameterFormatter(formattingModeReader, formatProvider, customValueFormatter));

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

            Initialize(factory);
            return(factory);
        }