Exemple #1
0
        /// <summary>
        /// log a msg
        /// uses wrapped logger for an initial rendering
        /// then, the re-renderer takes a pass
        /// </summary>
        /// <typeparam name="TState"></typeparam>
        /// <param name="logLevel"></param>
        /// <param name="eventId"></param>
        /// <param name="passedState"></param>
        /// <param name="passedException"></param>
        /// <param name="formatter"></param>
        public void Log <TState>(LogLevel logLevel, EventId eventId, TState passedState, Exception passedException, Func <TState, Exception, string> formatter)
        {
            const Exception dummyException = null;

            _logger.Log(logLevel, eventId, passedState, dummyException, (arrowState, arrowException) =>
            {
                var prerendered = formatter(arrowState, arrowException);

                // the real exception is dealt with by the re-renderer ONLY.
                return(_augrenderer.ReRender(logLevel, eventId, prerendered, passedState, IncludeScopes, passedException, _category, _cfg));
            });
        }