Updated logger
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
public interface ILogger
|
||||
{
|
||||
List<ILogMessage> LogMessages { get; protected set; }
|
||||
event Action<ILogMessage>? OnLogReceived;
|
||||
|
||||
void Log(string message);
|
||||
@@ -9,5 +10,4 @@ public interface ILogger
|
||||
void Log(string message, object sender);
|
||||
void Log(string message, object sender, LogType type);
|
||||
void LogException(Exception exception, object sender, bool logFullStack = false);
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ public sealed class Logger : ILogger
|
||||
{
|
||||
private readonly string _LogFile;
|
||||
private readonly string _LogMessageFormat;
|
||||
private readonly int _MaxHistorySize;
|
||||
|
||||
private readonly List<string> _logMessageProperties = typeof(ILogMessage)
|
||||
.GetProperties()
|
||||
@@ -11,21 +12,18 @@ public sealed class Logger : ILogger
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
public List<ILogMessage> LogMessages { get; set; }
|
||||
public event Action<ILogMessage>? OnLogReceived;
|
||||
|
||||
|
||||
public Logger(string logFolder, string logMessageFormat)
|
||||
public Logger(string logFolder, string logMessageFormat, int maxHistorySize)
|
||||
{
|
||||
this._LogMessageFormat = logMessageFormat;
|
||||
this._LogFile = Path.Combine(logFolder, $"{DateTime.Now:yyyy-MM-dd}.log");
|
||||
this._MaxHistorySize = maxHistorySize;
|
||||
LogMessages = new List<ILogMessage>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a formatted string based on the default parameters of the ILogMessage and a string defined as model
|
||||
/// </summary>
|
||||
/// <param name="message">The message</param>
|
||||
/// <returns>A formatted string with the message values</returns>
|
||||
private string GenerateLogMessage(ILogMessage message)
|
||||
{
|
||||
string messageAsString = new string(_LogMessageFormat);
|
||||
@@ -48,6 +46,11 @@ public sealed class Logger : ILogger
|
||||
{
|
||||
var messageAsString = GenerateLogMessage(message);
|
||||
OnLogReceived?.Invoke(message);
|
||||
LogMessages.Add(message);
|
||||
if (LogMessages.Count > _MaxHistorySize)
|
||||
{
|
||||
LogMessages.RemoveAt(0);
|
||||
}
|
||||
await LogToFile(messageAsString);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -18,6 +18,7 @@ public static class Initializer
|
||||
private static readonly string DefaultConfigFile = "./Data/Resources/config.json";
|
||||
private static readonly string DefaultPluginFolder = "./Data/Plugins";
|
||||
private static readonly string DefaultPluginDatabaseFile = "./Data/Resources/plugins.json";
|
||||
private static readonly string DefaultMaxHistorySize = "1000";
|
||||
|
||||
public static void AddDiscordBotComponents(this IHostApplicationBuilder builder)
|
||||
{
|
||||
@@ -25,10 +26,14 @@ public static class Initializer
|
||||
{
|
||||
string logFormat = builder.Configuration["Logger:LogFormat"] ?? DefaultLogFormat;
|
||||
string logFolder = builder.Configuration["Logger:LogFolder"] ?? DefaultLogFolder;
|
||||
|
||||
string maxHistorySize = builder.Configuration["Logger:MaxHistorySize"] ?? DefaultMaxHistorySize;
|
||||
Directory.CreateDirectory(logFolder);
|
||||
if (!int.TryParse(maxHistorySize, out int maxHistorySizeInt))
|
||||
{
|
||||
maxHistorySizeInt = int.Parse(DefaultMaxHistorySize);
|
||||
}
|
||||
|
||||
ILogger logger = new Logger(logFolder, logFormat);
|
||||
ILogger logger = new Logger(logFolder, logFormat, maxHistorySizeInt);
|
||||
logger.OnLogReceived += (logMessage) =>
|
||||
{
|
||||
Console.WriteLine(logMessage.Message);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Discord.Net" Version="3.17.2" />
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -12,15 +13,15 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="libs\**"/>
|
||||
<Compile Remove="libs\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="libs\**"/>
|
||||
<EmbeddedResource Remove="libs\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="libs\**"/>
|
||||
<None Remove="libs\**" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -40,65 +40,181 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM64 = Release|ARM64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Debug|x64.Build.0 = Debug|x64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Release|x64.ActiveCfg = Release|x64
|
||||
{5A99BFC3-EB39-4AEF-8D61-3CE22D013B02}.Release|x64.Build.0 = Release|x64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Debug|x64.Build.0 = Debug|x64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Release|x64.ActiveCfg = Release|x64
|
||||
{FCE9743F-7EB4-4639-A080-FCDDFCC7D689}.Release|x64.Build.0 = Release|x64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Debug|x64.Build.0 = Debug|x64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Release|x64.ActiveCfg = Release|x64
|
||||
{F3C61A47-F758-4145-B496-E3ECCF979D89}.Release|x64.Build.0 = Release|x64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Debug|x64.Build.0 = Debug|x64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Release|x64.ActiveCfg = Release|x64
|
||||
{C67908F9-4A55-4DD8-B993-C26C648226F1}.Release|x64.Build.0 = Release|x64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Debug|x64.Build.0 = Debug|x64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Release|x64.ActiveCfg = Release|x64
|
||||
{B5725C86-2633-4C7A-A6A4-49AAA2767E54}.Release|x64.Build.0 = Release|x64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Debug|x64.Build.0 = Debug|x64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Release|x64.ActiveCfg = Release|x64
|
||||
{10D064BB-399F-45DA-B64A-D68740A89E0F}.Release|x64.Build.0 = Release|x64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Debug|x64.Build.0 = Debug|x64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Release|x64.ActiveCfg = Release|x64
|
||||
{AAD94C92-3048-4785-9D29-634C97152760}.Release|x64.Build.0 = Release|x64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Debug|x64.Build.0 = Debug|x64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Release|x64.ActiveCfg = Release|x64
|
||||
{81E234B7-5182-4883-B70A-66D45F1D2427}.Release|x64.Build.0 = Release|x64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Debug|x64.Build.0 = Debug|x64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Release|x64.ActiveCfg = Release|x64
|
||||
{0EDC103A-C248-4146-98AC-3398B8FBC40F}.Release|x64.Build.0 = Release|x64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Debug|x64.Build.0 = Debug|x64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Release|x64.ActiveCfg = Release|x64
|
||||
{BB77A7A4-0D6E-428C-9279-6301F4F85BE1}.Release|x64.Build.0 = Release|x64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Debug|x64.Build.0 = Debug|x64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Release|x64.ActiveCfg = Release|x64
|
||||
{E8ED73E1-F7D9-44E7-9542-21BC86338724}.Release|x64.Build.0 = Release|x64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Debug|x64.Build.0 = Debug|x64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Release|x64.ActiveCfg = Release|x64
|
||||
{6D43E9A7-A295-41AC-8B2A-9A877FABB5DE}.Release|x64.Build.0 = Release|x64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Debug|x64.Build.0 = Debug|x64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Release|x64.ActiveCfg = Release|x64
|
||||
{A65A1D7A-99E9-463F-A205-F96CA54D5C51}.Release|x64.Build.0 = Release|x64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Debug|x64.Build.0 = Debug|x64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Release|x64.ActiveCfg = Release|x64
|
||||
{DE42253E-2ED6-4653-B9CC-C2C2551E1EA8}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="col-md-8">
|
||||
<h4>Console Log</h4>
|
||||
<div id="consoleLog" class="border p-3 bg-dark text-white" style="height: 400px; overflow-y: auto; font-family: monospace;">
|
||||
@foreach (var line in _Logs)
|
||||
@foreach (var line in Logger.LogMessages)
|
||||
{
|
||||
<div style="@GetLogStyle(line)">@line.Message</div>
|
||||
}
|
||||
@@ -49,8 +49,6 @@
|
||||
|
||||
@code {
|
||||
private bool IsRunning { get; set; }
|
||||
private List<ILogMessage> _Logs { get; set; } = new();
|
||||
private const int MaxLogLines = 1000;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
@@ -62,14 +60,8 @@
|
||||
{
|
||||
InvokeAsync(async () =>
|
||||
{
|
||||
_Logs.Add(obj);
|
||||
if (_Logs.Count > MaxLogLines)
|
||||
{
|
||||
_Logs.RemoveAt(0);
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
await JS.InvokeVoidAsync("scrollToBottom", "consoleLog");
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -120,6 +112,6 @@
|
||||
|
||||
private void ClearLogs()
|
||||
{
|
||||
_Logs.Clear();
|
||||
Logger.LogMessages.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Platforms>AnyCPU;x64;ARM64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user