Skip to content

Commit

Permalink
Analogy.LogViewer.Serilog.Sinks NET8
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Nov 15, 2023
1 parent 5bae7b2 commit 58c4a25
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<VersionPrefix>5.0.3.1</VersionPrefix>
<VersionPrefix>6.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Lior Banai</Authors>
<Company>Analogy.LogViewer</Company>
Expand All @@ -28,22 +28,8 @@
<PackagePath></PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'net471' ">
<PackageReference Include="PolySharp" Version="1.13.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Analogy.LogServer.Clients" Version="5.0.3.1" />
<PackageReference Include="Microsoft.Build.Tasks.Git" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Analogy.LogServer.Clients" Version="6.0.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public AnalogyLogServerSink(IFormatProvider formatProvider)
_formatProvider = formatProvider;
logServerMessageProducer = new AnalogyMessageProducer("http://localhost:6000");
}

/// <summary>
///
/// </summary>
Expand All @@ -29,10 +30,9 @@ public AnalogyLogServerSink(IFormatProvider formatProvider, string address)
}
public void Emit(LogEvent logEvent)
{

var alm = ParseLogEventProperties(logEvent, in _formatProvider);
logServerMessageProducer?.Log(alm.Text, alm.Source, alm.Level, "", alm.MachineName, alm.User,
alm.Module, alm.ProcessId, alm.ThreadId, alm.AdditionalProperties, alm.MethodName, alm.LineNumber, alm.FileName);
_ = (logServerMessageProducer?.Log(alm.Text, alm.Source, alm.Level, "", alm.MachineName, alm.User,

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'text' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'source' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'machineName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'userName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'text' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'source' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'machineName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 34 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'userName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.
alm.Module, alm.ProcessId, alm.ThreadId, alm.AdditionalProperties, alm.MethodName, alm.LineNumber, alm.FileName));

Check warning on line 35 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'processName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 35 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'additionalInformation' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 35 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'memberName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 35 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Release)

Possible null reference argument for parameter 'filePath' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 35 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'processName' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.

Check warning on line 35 in Analogy.LogViewer.Serilog.Sinks/AnalogyLogServerSink.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Possible null reference argument for parameter 'additionalInformation' in 'Task AnalogyMessageProducer.Log(string text, string source, AnalogyLogLevel level, string category = "", string machineName = null, string userName = null, string processName = null, int processId = 0, int threadId = 0, Dictionary<string, string> additionalInformation = null, string memberName = "", long lineNumber = 0, string filePath = "")'.
}

public static AnalogyLogMessage ParseLogEventProperties(LogEvent evt, in IFormatProvider formatProvider)
Expand Down Expand Up @@ -160,4 +160,4 @@ public void Dispose()
logServerMessageProducer.Dispose();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using Serilog;
using Serilog;
using Serilog.Configuration;
using System;

namespace Analogy.LogViewer.Serilog.Sinks
{
Expand All @@ -17,4 +15,4 @@ public static LoggerConfiguration AnalogyLogServerSink(this LoggerSinkConfigurat
return loggerConfiguration.Sink(new AnalogyLogServerSink(formatProvider, address));
}
}
}
}
3 changes: 1 addition & 2 deletions Analogy.LogViewer.Serilog.Sinks/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ public static Dictionary<string, string> GetFieldValues()
.Where(f => f.FieldType == typeof(string))
.ToDictionary(f => f.Name, f => (string)f.GetValue(null));

Check warning on line 23 in Analogy.LogViewer.Serilog.Sinks/Constants.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

Converting null literal or possible null value to non-nullable type.
}

}
}
}

0 comments on commit 58c4a25

Please sign in to comment.