Skip to content

3.4.0 Release #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Report a bug and help us to improve Serilog.Expressions
title: ''
labels: bug
assignees: ''

---

The Serilog maintainers want you to have a great experience using Serilog.Expressions, and will happily track down and resolve bugs. We all have limited time, though, so please think through all of the factors that might be involved and include as much useful information as possible 😊.

ℹ If the problem is caused by a sink or other extension package, please track down the correct repository for that package and create the report there: this tracker is for the **Serilog.Expressions** package only.

**Description**
What's going wrong?

**Reproduction**
Please provide code samples showing how you're configuring and calling Serilog.Expressions to produce the behavior.

**Expected behavior**
A concise description of what you expected to happen.

**Relevant package, tooling and runtime versions**
What Serilog version are you using, on what platform?

**Additional context**
Add any other context about the problem here.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Ask for help
url: https://stackoverflow.com/tags/serilog
about: Ask the community for help on how to use Serilog.Expressions
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an improvement to Serilog.Expressions
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. For example, "I'd like to do _x_ but currently I can't because _y_ [...]".

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any workarounds or alternative solutions you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 6 additions & 8 deletions src/Serilog.Expressions/Expressions/Runtime/RuntimeOperators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Linq;
using Serilog.Events;
using Serilog.Expressions.Compilation.Linq;
using Serilog.Templates.Rendering;

// ReSharper disable ForCanBeConvertedToForeach, InvertIf, MemberCanBePrivate.Global, UnusedMember.Global, InconsistentNaming, ReturnTypeCanBeNotNullable

Expand Down Expand Up @@ -501,15 +502,12 @@ public static LogEventPropertyValue _Internal_IsNotNull(LogEventPropertyValue? v
return null;
}

string? toString;
if (sv.Value is IFormattable formattable)
var toString = sv.Value switch
{
toString = formattable.ToString(fmt, formatProvider);
}
else
{
toString = sv.Value.ToString();
}
LogEventLevel level => LevelRenderer.GetLevelMoniker(level, fmt),
IFormattable formattable => formattable.ToString(fmt, formatProvider),
_ => sv.Value.ToString()
};

return new ScalarValue(toString);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Serilog.Expressions/Serilog.Expressions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>An embeddable mini-language for filtering, enriching, and formatting Serilog
events, ideal for use with JSON or XML configuration.</Description>
<VersionPrefix>3.3.0</VersionPrefix>
<VersionPrefix>3.4.0</VersionPrefix>
<Authors>Serilog Contributors</Authors>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Hello, {'world'}! ⇶ Hello, world!
{@l} ⇶ Information
{@l:u3} ⇶ INF
{ {level: ToString(@l, 'u3')} } ⇶ {"level":"INF"}
Items are {[1, 2]} ⇶ Items are [1,2]
Members are { {a: 1, 'b c': 2} } ⇶ Members are {"a":1,"b c":2}
{@p} ⇶ {"Name":"nblumhardt"}
Expand Down