This repository has been archived by the owner on Feb 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from serilog/dev
1.1.0 Release
- Loading branch information
Showing
40 changed files
with
431 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp1.0</TargetFramework> | ||
<AssemblyName>Sample</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>Sample</PackageId> | ||
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback> | ||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | ||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> | ||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Serilog.Filters.Expressions\Serilog.Filters.Expressions.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Serilog.Sinks.Literate" Version="2.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/Serilog.Filters.Expressions/Filters/Expressions/Ast/FilterArrayExpression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Serilog.Filters.Expressions.Ast | ||
{ | ||
class FilterArrayExpression : FilterExpression | ||
{ | ||
public FilterArrayExpression(FilterExpression[] elements) | ||
{ | ||
Elements = elements ?? throw new ArgumentNullException(nameof(elements)); | ||
} | ||
|
||
public FilterExpression[] Elements { get; } | ||
|
||
public override string ToString() | ||
{ | ||
return "[" + string.Join(",", Elements.Select(o => o.ToString())) + "]"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ enum FilterExpressionType | |
Subproperty, | ||
Wildcard, | ||
Parameter, | ||
Lambda | ||
Lambda, | ||
Array | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ressions/Filters/Expressions/Compilation/Arrays/FilterExpressionConstantArrayEvaluator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Linq; | ||
using Serilog.Events; | ||
using Serilog.Filters.Expressions.Ast; | ||
using Serilog.Filters.Expressions.Compilation.Transformations; | ||
using Serilog.Filters.Expressions.Runtime; | ||
|
||
namespace Serilog.Filters.Expressions.Compilation.Arrays | ||
{ | ||
class FilterExpressionConstantArrayEvaluator : FilterExpressionIdentityTransformer | ||
{ | ||
public static FilterExpression Evaluate(FilterExpression expression) | ||
{ | ||
var evaluator = new FilterExpressionConstantArrayEvaluator(); | ||
return evaluator.Transform(expression); | ||
} | ||
|
||
protected override FilterExpression Transform(FilterArrayExpression ax) | ||
{ | ||
// This should probably go depth-first. | ||
|
||
if (ax.Elements.All(el => el is FilterConstantExpression)) | ||
{ | ||
return new FilterConstantExpression( | ||
new SequenceValue(ax.Elements | ||
.Cast<FilterConstantExpression>() | ||
.Select(ce => Representation.Recapture(ce.ConstantValue)))); | ||
} | ||
|
||
return base.Transform(ax); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...g.Filters.Expressions/Filters/Expressions/Compilation/In/FilterExpressionNotInRewriter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Serilog.Filters.Expressions.Ast; | ||
using Serilog.Filters.Expressions.Compilation.Transformations; | ||
|
||
namespace Serilog.Filters.Expressions.Compilation.In | ||
{ | ||
class FilterExpressionNotInRewriter : FilterExpressionIdentityTransformer | ||
{ | ||
public static FilterExpression Rewrite(FilterExpression expression) | ||
{ | ||
var rewriter = new FilterExpressionNotInRewriter(); | ||
return rewriter.Transform(expression); | ||
} | ||
|
||
protected override FilterExpression Transform(FilterCallExpression lx) | ||
{ | ||
if (Operators.SameOperator(Operators.IntermediateOpSqlNotIn, lx.OperatorName)) | ||
return new FilterCallExpression(Operators.RuntimeOpStrictNot, | ||
new FilterCallExpression(Operators.RuntimeOpSqlIn, lx.Operands)); | ||
return base.Transform(lx); | ||
} | ||
} | ||
} |
Oops, something went wrong.