Skip to content

Commit

Permalink
add NET7
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorBanai committed Nov 9, 2022
1 parent ea988bd commit 42a5ac2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Analogy.LogViewer.Template/Analogy.LogViewer.Template.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFrameworks>net6.0-windows;net5.0-windows;netcoreapp3.1;net48;net472;net471</TargetFrameworks>
<TargetFrameworks>net7.0-windows;net6.0-windows;net48;net471</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<OutputType>Library</OutputType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -21,14 +21,14 @@
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>Template implementation to be used as base implementation</PackageReleaseNotes>
<NeutralLanguage>en-US</NeutralLanguage>
<Version>3.4.1</Version>
<Version>3.5.0</Version>
<Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Analogy.CommonUtilities" Version="3.4.1" />
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="3.4.0" />
<PackageReference Include="Analogy.CommonUtilities" Version="3.5.0" />
<PackageReference Include="Analogy.LogViewer.Interfaces" Version="3.5.0" />
<PackageReference Include="Microsoft.Build.Tasks.Git" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
3 changes: 3 additions & 0 deletions Analogy.LogViewer.Template/IAnalogy/OnlineDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ public virtual void MessageOpened(AnalogyLogMessage message)
protected void Disconnected(object sender, AnalogyDataSourceDisconnectedArgs args) => OnDisconnected?.Invoke(sender, args);
protected void MessageReady(object sender, AnalogyLogMessageArgs message) => OnMessageReady?.Invoke(sender, message);
protected void MessagesReady(object sender, AnalogyLogMessagesArgs messages) => OnManyMessagesReady?.Invoke(sender, messages);

public abstract Task ShutDown();

}
}
19 changes: 18 additions & 1 deletion Analogy.LogViewer.Template/Managers/LogManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Analogy.Interfaces;
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;

namespace Analogy.LogViewer.Template.Managers
{
Expand Down Expand Up @@ -114,12 +115,28 @@ public virtual void LogException(string message, Exception ex, string source, st
{
if (Logger == null)
{
PendingMessages.Add((AnalogyLogLevel.Error, source, $"Error: {message.Length }Exception: {ex}", memberName, lineNumber, filePath));
PendingMessages.Add((AnalogyLogLevel.Error, source, $"Error: {message.Length}Exception: {ex}", memberName, lineNumber, filePath));
}
else
{
Logger.LogException(message, ex, source, memberName, lineNumber, filePath);
}
}

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
Logger?.Log(logLevel, eventId, state, exception, formatter);

}

public bool IsEnabled(LogLevel logLevel)
{
return Logger?.IsEnabled(logLevel) ?? false;
}

public IDisposable? BeginScope<TState>(TState state) where TState : notnull
{
return Logger?.BeginScope(state);
}
}
}

0 comments on commit 42a5ac2

Please sign in to comment.