about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/LogView.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 00:13:25 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 00:18:46 +0200
commitb933f7ed1189c7e14d82b4fcf5c98fb3ef4b9cf1 (patch)
tree4176eb2b7f1befca685d00e119d842eb3f07da1f /MatrixRoomUtils.Web/Shared/LogView.razor
parentSmall refactoring (diff)
downloadMatrixUtils-b933f7ed1189c7e14d82b4fcf5c98fb3ef4b9cf1.tar.xz
Refactoring
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/LogView.razor')
-rw-r--r--MatrixRoomUtils.Web/Shared/LogView.razor11
1 files changed, 6 insertions, 5 deletions
diff --git a/MatrixRoomUtils.Web/Shared/LogView.razor b/MatrixRoomUtils.Web/Shared/LogView.razor
index fbe5264..f60f271 100644
--- a/MatrixRoomUtils.Web/Shared/LogView.razor
+++ b/MatrixRoomUtils.Web/Shared/LogView.razor
@@ -1,15 +1,15 @@
 @using System.Text
 <u>Logs</u><br/>
 <pre>
-    @sb
+    @_stringBuilder
 </pre>
 
 @code {
-    StringBuilder sb = new();
+    StringBuilder _stringBuilder = new();
     protected override void OnInitialized()
     {
         //intecept stdout with textwriter to get logs
-        var sw = new StringWriter(sb);
+        var sw = new StringWriter(_stringBuilder);
         Console.SetOut(sw);
         Console.SetError(sw);
         //keep updated
@@ -19,12 +19,13 @@
             while (true)
             {
                 await Task.Delay(100);
-                if (sb.Length != length)
+                if (_stringBuilder.Length != length)
                 {
                     StateHasChanged();
-                    length = sb.Length;
+                    length = _stringBuilder.Length;
                 }
             }
+    // ReSharper disable once FunctionNeverReturns - This is intentional behavior
         });
         base.OnInitialized();
     }