Skip to content

NLog - MessageTemplateParameters - Always parse when IsPositional#2340

Merged
304NotModified merged 2 commits into
NLog:masterfrom
snakefoot:IsPositionalMessageTemplateParseAlways
Oct 12, 2017
Merged

NLog - MessageTemplateParameters - Always parse when IsPositional#2340
304NotModified merged 2 commits into
NLog:masterfrom
snakefoot:IsPositionalMessageTemplateParseAlways

Conversation

@snakefoot

Copy link
Copy Markdown
Contributor

Fixes the IsPositional parsing issue reported by #2339

@snakefoot snakefoot force-pushed the IsPositionalMessageTemplateParseAlways branch from 4412e02 to 36d3b81 Compare October 11, 2017 19:13
@codecov

codecov Bot commented Oct 11, 2017

Copy link
Copy Markdown

Codecov Report

Merging #2340 into master will increase coverage by <1%.
The diff coverage is 56%.

@@           Coverage Diff           @@
##           master   #2340    +/-   ##
=======================================
+ Coverage      82%     82%   +<1%     
=======================================
  Files         317     317            
  Lines       22716   22703    -13     
  Branches     2784    2784            
=======================================
+ Hits        18609   18610     +1     
+ Misses       3405    3391    -14     
  Partials      702     702

break;
var hole = templateEnumerator.Current.Hole;
if (hole.Index == -1)
templateParameters.Add(new MessageTemplateParameter(hole.Name, parameters[holeIndex++], hole.Format));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we're using .MoveNext here, isn't return yield a better way?

@@ -61,15 +63,15 @@ internal class MessageTemplateParameters : IMessageTemplateParameters
/// <summary>
/// Constructore for positional parameters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo ;)

/// Constructore for positional parameters
/// </summary>
public MessageTemplateParameters(object[] parameters)
public MessageTemplateParameters(string message, object[] parameters)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the original non-formatted message, isn't?

@304NotModified 304NotModified merged commit e10fd56 into NLog:master Oct 12, 2017
@304NotModified 304NotModified added this to the 4.5 beta 5 milestone Oct 12, 2017
@snakefoot snakefoot deleted the IsPositionalMessageTemplateParseAlways branch January 29, 2018 18:11
@snakefoot snakefoot modified the milestones: 4.5 beta 5, 4.5 Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants