diff --git a/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs b/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs index 3c05ff80..f472713d 100644 --- a/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs +++ b/TIAMSharedUI/Pages/Components/AuthComponent.razor.cs @@ -51,6 +51,8 @@ namespace TIAMSharedUI.Pages.Components //} componentUpdateService.CallRequestRefresh(); StateHasChanged(); + + //_logger.Error($"ERRROROOROROROROROROROOROROR TEST"); } protected override void OnAfterRender(bool firstRender) diff --git a/TIAMWebApp/Shared/Services/ServiceProviderDataService.cs b/TIAMWebApp/Shared/Services/ServiceProviderDataService.cs index 27bbb037..eba20467 100644 --- a/TIAMWebApp/Shared/Services/ServiceProviderDataService.cs +++ b/TIAMWebApp/Shared/Services/ServiceProviderDataService.cs @@ -142,6 +142,7 @@ namespace TIAMWebApp.Shared.Application.Services var result = await response.Content.ReadAsStringAsync(); //_logger.Detail("Json: " + result); var data = JsonConvert.DeserializeObject>(result); + if (data != null) { return data; diff --git a/TIAMWebApp/Shared/Utility/BrowserConsoleLogWriter.cs b/TIAMWebApp/Shared/Utility/BrowserConsoleLogWriter.cs index a92eacd6..cfb634e6 100644 --- a/TIAMWebApp/Shared/Utility/BrowserConsoleLogWriter.cs +++ b/TIAMWebApp/Shared/Utility/BrowserConsoleLogWriter.cs @@ -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(); - //} + private readonly Dictionary _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)