Skip to content

Commit 9897213

Browse files
committed
Improve log
1 parent a49c465 commit 9897213

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public partial class MainViewModel : BaseModel, ISavable, IDisposable
3131
{
3232
#region Private Fields
3333

34+
private static string ClassName = nameof(MainViewModel);
35+
3436
private bool _isQueryRunning;
3537
private Query _lastQuery;
3638
private string _queryTextBeforeLeaveResults;
@@ -214,7 +216,7 @@ async Task UpdateActionAsync()
214216
}
215217

216218
if (!_disposed)
217-
Log.Error("MainViewModel", "Unexpected ResultViewUpdate ends");
219+
Log.Error(ClassName, "Unexpected ResultViewUpdate ends");
218220
}
219221

220222
void continueAction(Task t)
@@ -250,7 +252,7 @@ public void RegisterResultsUpdatedEvent()
250252
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, pair.Metadata, e.Query,
251253
token)))
252254
{
253-
Log.Error("MainViewModel", "Unable to add item to Result Update Queue");
255+
Log.Error(ClassName, "Unable to add item to Result Update Queue");
254256
}
255257
};
256258
}
@@ -885,7 +887,7 @@ public bool InternalPreviewVisible
885887
#if DEBUG
886888
throw new NotImplementedException("ResultAreaColumn should match ResultAreaColumnPreviewShown/ResultAreaColumnPreviewHidden value");
887889
#else
888-
Log.Error("MainViewModel", "ResultAreaColumnPreviewHidden/ResultAreaColumnPreviewShown int value not implemented", "InternalPreviewVisible");
890+
Log.Error(ClassName, "ResultAreaColumnPreviewHidden/ResultAreaColumnPreviewShown int value not implemented", "InternalPreviewVisible");
889891
return false;
890892
#endif
891893
}
@@ -1279,7 +1281,7 @@ async Task QueryTaskAsync(PluginPair plugin, bool reSelect = true)
12791281
if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, plugin.Metadata, query,
12801282
_updateSource.Token, reSelect)))
12811283
{
1282-
Log.Error("MainViewModel", "Unable to add item to Result Update Queue");
1284+
Log.Error(ClassName, "Unable to add item to Result Update Queue");
12831285
}
12841286
}
12851287
}
@@ -1335,7 +1337,7 @@ private async Task<Query> ConstructQueryAsync(string queryText, IEnumerable<Cust
13351337
}
13361338
catch (Exception e)
13371339
{
1338-
App.API.LogException(nameof(MainViewModel), $"Error when expanding shortcut {shortcut.Key}", e);
1340+
App.API.LogException(ClassName, $"Error when expanding shortcut {shortcut.Key}", e);
13391341
}
13401342
}
13411343

0 commit comments

Comments
 (0)