Skip to content

Commit 0ee44d1

Browse files
authored
Merge pull request #75 from serilog/dev
3.4.0 Release
2 parents 579fe6e + 645b7d2 commit 0ee44d1

File tree

6 files changed

+59
-9
lines changed

6 files changed

+59
-9
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Report a bug and help us to improve Serilog.Expressions
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
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 😊.
11+
12+
ℹ 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.
13+
14+
**Description**
15+
What's going wrong?
16+
17+
**Reproduction**
18+
Please provide code samples showing how you're configuring and calling Serilog.Expressions to produce the behavior.
19+
20+
**Expected behavior**
21+
A concise description of what you expected to happen.
22+
23+
**Relevant package, tooling and runtime versions**
24+
What Serilog version are you using, on what platform?
25+
26+
**Additional context**
27+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Ask for help
3+
url: https://stackoverflow.com/tags/serilog
4+
about: Ask the community for help on how to use Serilog.Expressions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an improvement to Serilog.Expressions
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
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_ [...]".
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any workarounds or alternative solutions you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

src/Serilog.Expressions/Expressions/Runtime/RuntimeOperators.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Linq;
1818
using Serilog.Events;
1919
using Serilog.Expressions.Compilation.Linq;
20+
using Serilog.Templates.Rendering;
2021

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

@@ -501,15 +502,12 @@ public static LogEventPropertyValue _Internal_IsNotNull(LogEventPropertyValue? v
501502
return null;
502503
}
503504

504-
string? toString;
505-
if (sv.Value is IFormattable formattable)
505+
var toString = sv.Value switch
506506
{
507-
toString = formattable.ToString(fmt, formatProvider);
508-
}
509-
else
510-
{
511-
toString = sv.Value.ToString();
512-
}
507+
LogEventLevel level => LevelRenderer.GetLevelMoniker(level, fmt),
508+
IFormattable formattable => formattable.ToString(fmt, formatProvider),
509+
_ => sv.Value.ToString()
510+
};
513511

514512
return new ScalarValue(toString);
515513
}

src/Serilog.Expressions/Serilog.Expressions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>An embeddable mini-language for filtering, enriching, and formatting Serilog
55
events, ideal for use with JSON or XML configuration.</Description>
6-
<VersionPrefix>3.3.0</VersionPrefix>
6+
<VersionPrefix>3.4.0</VersionPrefix>
77
<Authors>Serilog Contributors</Authors>
88
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>

test/Serilog.Expressions.Tests/Cases/template-evaluation-cases.asv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Hello, {'world'}! ⇶ Hello, world!
22
{@l} ⇶ Information
33
{@l:u3} ⇶ INF
4+
{ {level: ToString(@l, 'u3')} } ⇶ {"level":"INF"}
45
Items are {[1, 2]} ⇶ Items are [1,2]
56
Members are { {a: 1, 'b c': 2} } ⇶ Members are {"a":1,"b c":2}
67
{@p} ⇶ {"Name":"nblumhardt"}

0 commit comments

Comments
 (0)