Skip to content

Commit 95a41c8

Browse files
authored
Merge pull request #143 from datalust/dev
2025.1.0 Release
2 parents 78b71d9 + 94cae98 commit 95a41c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+783
-627
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ artifacts:
99
deploy:
1010
- provider: NuGet
1111
api_key:
12-
secure: uJjVQ3SRUEcaUqdyKuuIvtrpNrO+u9P07aLbUumFiqZhjj3uI+PlZULv8JtgrxR/
12+
secure: Jxi/gameJWSW1ncE+SpU6C51kENE7mSxtKYPnM5CrvTYnfpaf8Y5B7PsROv2Oglg
1313
skip_symbols: true
1414
on:
1515
branch: /^(main|dev)$/

example/SeqEnableAAD/SeqEnableAAD.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<AssemblyName>seq-enable-aad</AssemblyName>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

example/SeqQuery/SeqQuery.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<AssemblyName>seq-query</AssemblyName>
77
<Nullable>enable</Nullable>

example/SeqTail/Program.cs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using DocoptNet;
44
using Seq.Api;
55
using Serilog;
6-
using System.Reactive.Linq;
76
using Serilog.Formatting.Compact.Reader;
87
using System.Threading;
9-
using Newtonsoft.Json.Linq;
8+
9+
// ReSharper disable AccessToDisposedClosure
1010

1111
const string usage = @"seq-tail: watch a Seq query from your console.
1212
@@ -29,17 +29,17 @@
2929

3030
try
3131
{
32-
var arguments = new Docopt().Apply(usage, args, version: "Seq Tail 0.2", exit: true)!;
32+
var arguments = new Docopt().Apply(usage, args, version: "Seq Tail 0.3", exit: true)!;
3333

3434
var server = arguments["<server>"].ToString();
3535
var apiKey = Normalize(arguments["--apikey"]);
3636
var filter = Normalize(arguments["--filter"]);
3737

38-
var cancel = new CancellationTokenSource();
38+
using var cts = new CancellationTokenSource();
3939
Console.WriteLine("Tailing, press Ctrl+C to exit.");
40-
Console.CancelKeyPress += (_,_) => cancel.Cancel();
40+
Console.CancelKeyPress += (_,_) => cts.Cancel();
4141

42-
var run = Task.Run(() => Run(server, apiKey, filter, cancel), cancel.Token);
42+
var run = Task.Run(() => Run(server, apiKey, filter, cts.Token), cts.Token);
4343

4444
run.GetAwaiter().GetResult();
4545
}
@@ -56,22 +56,20 @@
5656
return string.IsNullOrWhiteSpace(s) ? null : s;
5757
}
5858

59-
static async Task Run(string server, string? apiKey, string? filter, CancellationTokenSource cancel)
59+
static async Task Run(string server, string? apiKey, string? filter, CancellationToken cancel)
6060
{
6161
var connection = new SeqConnection(server, apiKey);
6262

63-
string? strict = null;
63+
string? strictFilter = null;
6464
if (filter != null)
6565
{
6666
var converted = await connection.Expressions.ToStrictAsync(filter);
67-
strict = converted.StrictExpression;
67+
strictFilter = converted.StrictExpression;
6868
}
6969

70-
using var stream = await connection.Events.StreamAsync<JObject>(filter: strict);
71-
var subscription = stream
72-
.Select(LogEventReader.ReadFromJObject)
73-
.Subscribe(Log.Write, cancel.Cancel);
74-
75-
cancel.Token.WaitHandle.WaitOne();
76-
subscription.Dispose();
70+
await foreach (var evt in connection.Events.StreamDocumentsAsync(filter: strictFilter, clef: true, cancellationToken: cancel))
71+
{
72+
var logEvent = LogEventReader.ReadFromString(evt);
73+
Log.Write(logEvent);
74+
}
7775
}

example/SeqTail/SeqTail.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<AssemblyName>seq-tail</AssemblyName>
66
<OutputType>Exe</OutputType>
77
<Nullable>enable</Nullable>

example/SignalCopy/SignalCopy.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<AssemblyName>signal-copy</AssemblyName>
66
<OutputType>Exe</OutputType>
77
<Nullable>enable</Nullable>

src/Seq.Api/Client/SeqApiClient.cs

Lines changed: 131 additions & 57 deletions
Large diffs are not rendered by default.

src/Seq.Api/Client/SeqApiException.cs

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,47 @@
1515
using System;
1616
using System.Net;
1717

18-
namespace Seq.Api.Client
18+
#nullable enable
19+
20+
namespace Seq.Api.Client;
21+
22+
/// <summary>
23+
/// Thrown when an action cannot be performed.
24+
/// </summary>
25+
public class SeqApiException : Exception
1926
{
2027
/// <summary>
21-
/// Thrown when an action cannot be performed.
28+
/// Construct a <see cref="SeqApiException"/> with the given message and status code.
2229
/// </summary>
23-
public class SeqApiException : Exception
30+
/// <param name="message">A message describing the error.</param>
31+
public SeqApiException(string message)
32+
: base(message)
2433
{
25-
/// <summary>
26-
/// Construct a <see cref="SeqApiException"/> with the given message and status code.
27-
/// </summary>
28-
/// <param name="message">A message describing the error.</param>
29-
/// <param name="statusCode">The corresponding status code returned from Seq, if available.</param>
30-
public SeqApiException(string message, HttpStatusCode? statusCode)
31-
: base(message)
32-
{
33-
StatusCode = statusCode;
34-
}
35-
36-
/// <summary>
37-
/// The status code returned from Seq, if available.
38-
/// </summary>
39-
public HttpStatusCode? StatusCode { get; }
4034
}
35+
36+
/// <summary>
37+
/// Construct a <see cref="SeqApiException"/> with the given message and status code.
38+
/// </summary>
39+
/// <param name="message">A message describing the error.</param>
40+
/// <param name="statusCode">The corresponding status code returned from Seq, if available.</param>
41+
public SeqApiException(string message, HttpStatusCode? statusCode)
42+
: this(message)
43+
{
44+
StatusCode = statusCode;
45+
}
46+
47+
/// <summary>
48+
/// Construct a <see cref="SeqApiException"/> with the given message and status code.
49+
/// </summary>
50+
/// <param name="message">A message describing the error.</param>
51+
/// <param name="innerException">The cause of the API failure.</param>
52+
public SeqApiException(string message, Exception innerException)
53+
: base(message, innerException)
54+
{
55+
}
56+
57+
/// <summary>
58+
/// The status code returned from Seq, if available.
59+
/// </summary>
60+
public HttpStatusCode? StatusCode { get; }
4161
}

src/Seq.Api/Model/Alerting/AlertOccurrencePart.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using Seq.Api.Model.AppInstances;
43
using Seq.Api.Model.LogEvents;
54
using Seq.Api.Model.Shared;
65

src/Seq.Api/Model/Alerting/AlertOccurrenceRangePart.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Seq.Api.Model.LogEvents;
2-
using Seq.Api.Model.Shared;
1+
using Seq.Api.Model.Shared;
32

43
namespace Seq.Api.Model.Alerting
54
{

0 commit comments

Comments
 (0)