Пример #1
0
        /// <summary>
        /// Creates a delegate which can be invoked to create a log scope.
        /// </summary>
        /// <param name="formatString">The named format string</param>
        /// <returns>A delegate which when invoked creates a log scope.</returns>
        public static Func <ILogger, IDisposable> DefineScope(string formatString)
        {
            var formatter = CreateLogValuesFormatter(formatString, expectedNamedParameterCount: 0);

            var logValues = new LogValues(formatter);

            return(logger => logger.BeginScope(logValues));
        }
Пример #2
0
        /// <summary>
        /// Creates a delegate which can be invoked to create a log scope.
        /// </summary>
        /// <param name="formatString">The named format string</param>
        /// <returns>A delegate which when invoked creates a log scope.</returns>
        public static Func <ILogger, IDisposable> DefineScope(string formatString)
        {
            var logValues = new LogValues(new LogValuesFormatter(formatString));

            return(logger => logger.BeginScope(logValues));
        }