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(); componentUpdateService.CallRequestRefresh();
StateHasChanged(); StateHasChanged();
//_logger.Error($"ERRROROOROROROROROROROOROROR TEST");
} }
protected override void OnAfterRender(bool firstRender) protected override void OnAfterRender(bool firstRender)

View File

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

View File

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