This commit is contained in:
jozsef.b@aycode.com 2024-05-19 06:03:23 +02:00
parent 62eef091ce
commit 1370a09e0f
3 changed files with 16 additions and 10 deletions

View File

@ -51,6 +51,8 @@ namespace TIAMSharedUI.Pages.Components
//}
componentUpdateService.CallRequestRefresh();
StateHasChanged();
//_logger.Error($"ERRROROOROROROROROROROOROROR TEST");
}
protected override void OnAfterRender(bool firstRender)

View File

@ -142,6 +142,7 @@ namespace TIAMWebApp.Shared.Application.Services
var result = await response.Content.ReadAsStringAsync();
//_logger.Detail("Json: " + result);
var data = JsonConvert.DeserializeObject<IEnumerable<Product>>(result);
if (data != null)
{
return data;

View File

@ -1,10 +1,7 @@
using System.Globalization;
using AyCode.Core.Consts;
using AyCode.Core.Enums;
using AyCode.Core.Enums;
using AyCode.Core.Loggers;
using AyCode.Services.Loggers;
using Microsoft.JSInterop;
using TIAMWebApp.Shared.Application.Models.ClientSide;
namespace TIAMWebApp.Shared.Application.Utility;
@ -21,19 +18,25 @@ public class BrowserConsoleLogWriter : AcTextLogWriterBase, IAcLogWriterClientBa
{
private readonly IJSRuntime _jsRuntime;
//public BrowserConsoleLogWriter() : base(AppType.Web, LogLevel.Debug)
//{
// _jsRuntime = Services.GetRequiredService<IJSRuntime>();
//}
private readonly Dictionary<LogLevel, string> _invokeConsoleNames = new()
{
[LogLevel.Detail] = "console.info", //trace
[LogLevel.Trace] = "console.info",
[LogLevel.Debug] = "console.info",
[LogLevel.Info] = "console.info",
[LogLevel.Suggest] = "console.info",
[LogLevel.Warning] = "console.warn",
[LogLevel.Error] = "console.error"
};
public BrowserConsoleLogWriter(IJSRuntime jsRuntime) : base(AppType.Web, LogLevel.Debug)
public BrowserConsoleLogWriter(IJSRuntime jsRuntime) : base(AppType.Web, LogLevel.Info)
{
_jsRuntime = jsRuntime;
}
protected override void WriteText(string? logText, LogLevel logLevel)
{
_jsRuntime.InvokeVoidAsync("console.log", logText);
_jsRuntime.InvokeVoidAsync(_invokeConsoleNames[logLevel], logText);
}
//public void Info(string message)