-
Notifications
You must be signed in to change notification settings - Fork 11
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 #24 from datalust/dev
2.0.0 Release
- Loading branch information
Showing
16 changed files
with
222 additions
and
80 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
Binary file not shown.
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,46 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Reflection; | ||
using Serilog.Events; | ||
using Serilog.Expressions; | ||
|
||
namespace Seq.Input.HealthCheck.Data | ||
{ | ||
public class SeqSyntaxNameResolver: NameResolver | ||
{ | ||
// ReSharper disable once UnusedMember.Global | ||
// ReSharper disable once ReturnTypeCanBeNotNullable | ||
public static LogEventPropertyValue? Has(LogEventPropertyValue? value) | ||
{ | ||
return new ScalarValue(value != null); | ||
} | ||
|
||
public override bool TryResolveFunctionName(string name, [NotNullWhen(true)] out MethodInfo? implementation) | ||
{ | ||
if ("Has".Equals(name, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
implementation = GetType().GetMethod("Has", BindingFlags.Static | BindingFlags.Public)!; | ||
return true; | ||
} | ||
|
||
implementation = null; | ||
return false; | ||
} | ||
|
||
public override bool TryResolveBuiltInPropertyName(string alias, [NotNullWhen(true)] out string? target) | ||
{ | ||
target = alias switch | ||
{ | ||
"Exception" => "x", | ||
"Level" => "l", | ||
"Message" => "m", | ||
"MessageTemplate" => "mt", | ||
"Properties" => "p", | ||
"Timestamp" => "t", | ||
_ => null | ||
}; | ||
|
||
return target != null; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.