Akka.Logger.Serilog.SerilogLogMessageFormatter.Format C# (CSharp) Method

Format() public method

Converts the specified template string to a text string using the specified token array to match replacements.
public Format ( string format ) : string
format string The template string used in the conversion.
return string
        public string Format(string format, params object[] args)
        {
            var template = _templateCache.Parse(format);
            var propertyTokens = template.Tokens.OfType<PropertyToken>().ToArray();
            var properties = new Dictionary<string, LogEventPropertyValue>();

            for (var i = 0; i < args.Length; i++)
            {
                var propertyToken = propertyTokens.ElementAtOrDefault(i);
                if (propertyToken == null)
                    break;

                properties.Add(propertyToken.PropertyName, new ScalarValue(args[i]));
            }

            return template.Render(properties);
        }
    }
SerilogLogMessageFormatter