diff --git a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs
index 6f3b23e11..2ff51ff73 100644
--- a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs
+++ b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs
@@ -73,6 +73,17 @@ namespace Flow.Launcher.Core.ExternalPlugins
return null;
}
}
+ catch (OperationCanceledException) when (token.IsCancellationRequested)
+ {
+ API.LogInfo(ClassName, $"Fetching from {ManifestFileUrl} was cancelled by caller.");
+ return null;
+ }
+ catch (TaskCanceledException)
+ {
+ // Likely an HttpClient timeout or external cancellation not requested by our token
+ API.LogWarn(ClassName, $"Fetching from {ManifestFileUrl} timed out.");
+ return null;
+ }
catch (Exception e)
{
if (e is HttpRequestException or WebException or SocketException || e.InnerException is TimeoutException)
diff --git a/Flow.Launcher.Infrastructure/Logger/Log.cs b/Flow.Launcher.Infrastructure/Logger/Log.cs
index 09eb98f46..2a5b826a9 100644
--- a/Flow.Launcher.Infrastructure/Logger/Log.cs
+++ b/Flow.Launcher.Infrastructure/Logger/Log.cs
@@ -34,7 +34,7 @@ namespace Flow.Launcher.Infrastructure.Logger
var fileTarget = new FileTarget
{
- FileName = CurrentLogDirectory.Replace(@"\", "/") + "/${shortdate}.txt",
+ FileName = CurrentLogDirectory.Replace(@"\", "/") + "/Flow.Launcher.${date:format=yyyy-MM-dd}.log",
Layout = layout
};
@@ -65,26 +65,22 @@ namespace Flow.Launcher.Infrastructure.Logger
public static void SetLogLevel(LOGLEVEL level)
{
- switch (level)
+ var rule = LogManager.Configuration.FindRuleByName("file");
+
+ var nlogLevel = level switch
{
- case LOGLEVEL.DEBUG:
- UseDebugLogLevel();
- break;
- default:
- UseInfoLogLevel();
- break;
- }
- Info(nameof(Logger), $"Using log level: {level}.");
- }
+ LOGLEVEL.NONE => LogLevel.Off,
+ LOGLEVEL.ERROR => LogLevel.Error,
+ LOGLEVEL.DEBUG => LogLevel.Debug,
+ _ => LogLevel.Info
+ };
- private static void UseDebugLogLevel()
- {
- LogManager.Configuration.FindRuleByName("file").SetLoggingLevels(LogLevel.Debug, LogLevel.Fatal);
- }
+ rule.SetLoggingLevels(nlogLevel, LogLevel.Fatal);
- private static void UseInfoLogLevel()
- {
- LogManager.Configuration.FindRuleByName("file").SetLoggingLevels(LogLevel.Info, LogLevel.Fatal);
+ LogManager.ReconfigExistingLoggers();
+
+ // We can't log Info when level is set to Error or None, so we use Debug
+ Debug(nameof(Logger), $"Using log level: {level}.");
}
private static void LogFaultyFormat(string message)
@@ -169,7 +165,9 @@ namespace Flow.Launcher.Infrastructure.Logger
public enum LOGLEVEL
{
- DEBUG,
- INFO
+ NONE,
+ ERROR,
+ INFO,
+ DEBUG
}
}
diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
index 0c3402050..23f9047fe 100644
--- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
+++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text.Json.Serialization;
using System.Windows;
diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml
index d2f78e1f6..f7fd0c8e5 100644
--- a/Flow.Launcher/Languages/en.xaml
+++ b/Flow.Launcher/Languages/en.xaml
@@ -462,8 +462,10 @@
Open Folder
Advanced
Log Level
- Debug
+ Silent
+ Error
Info
+ Debug
Setting Window Font