Skip to content

${when}, support for RawValue on Inner and Else#3373

Merged
304NotModified merged 2 commits intodevfrom
whenLayout-irawValue
May 6, 2019
Merged

${when}, support for RawValue on Inner and Else#3373
304NotModified merged 2 commits intodevfrom
whenLayout-irawValue

Conversation

@304NotModified
Copy link
Copy Markdown
Member

@304NotModified 304NotModified commented May 6, 2019

fixes #3139

@304NotModified 304NotModified added this to the 5.0 (new) milestone May 6, 2019
@304NotModified 304NotModified force-pushed the whenLayout-irawValue branch from 1ffaf36 to 2dfe3b6 Compare May 6, 2019 21:27
@304NotModified
Copy link
Copy Markdown
Member Author

@snakefoot I checked your comments in the other PR. Your right. I think I have proper implemented it now.

return false;
}

return Inner.TryGetRawValue(logEvent, out value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could this also work:

value = null;
if (ShouldRenderInner(logEvent))
   return Inner?.TryGetRawValue(logEvent, out value) ?? false;
else
   return Else?.TryGetRawValue(logEvent, out value) ?? false;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it should work, but a bit hard to read. But I see the problem of the verbose/duplicate code. Will create a helper and let's see if it's then better.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

PS: we need a helper

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added helper. Let me know what you think

@codecov-io
Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (dev@1ceaa36). Click here to learn what that means.
The diff coverage is 78%.

@@          Coverage Diff          @@
##             dev   #3373   +/-   ##
=====================================
  Coverage       ?     81%           
=====================================
  Files          ?     344           
  Lines          ?   27607           
  Branches       ?    3713           
=====================================
  Hits           ?   22290           
  Misses         ?    4243           
  Partials       ?    1074

@304NotModified 304NotModified merged commit f1ed38d into dev May 6, 2019
@repo-ranger repo-ranger bot deleted the whenLayout-irawValue branch May 6, 2019 23:18
304NotModified added a commit that referenced this pull request May 12, 2019
* ${when}, support for RawValue on Inner and Else

* Added helper
304NotModified added a commit that referenced this pull request May 20, 2019
* ${when}, support for RawValue on Inner and Else

* Added helper
304NotModified added a commit that referenced this pull request May 28, 2019
* ${when}, support for RawValue on Inner and Else

* Added helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IRawValue - support for renderers that *could* have layouts

3 participants