CherryPick Layout change and ProgramLogger.cs Fix

This commit is contained in:
Kevin Zhang 2021-06-22 13:05:38 +08:00 committed by 张弘韬
parent da6dfcdf6d
commit 4f13433913
2 changed files with 1 additions and 25 deletions

View file

@ -184,10 +184,6 @@ namespace Flow.Launcher.Core.Plugin
// null will be fine since the results will only be added into queue if the token hasn't been cancelled
return null;
}
catch (Exception e)
{
Log.Exception("PluginManager", "Exception", e);
}
return results;
}

View file

@ -20,27 +20,6 @@ namespace Flow.Launcher.Plugin.Program.Logger
{
public const string DirectoryName = "Logs";
static ProgramLogger()
{
var path = Path.Combine(DataLocation.DataDirectory(), DirectoryName, Constant.Version);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var configuration = new LoggingConfiguration();
var target = new FileTarget();
configuration.AddTarget("file", target);
target.FileName = path.Replace(@"\", "/") + "/${shortdate}.txt";
#if DEBUG
var rule = new LoggingRule("*", LogLevel.Debug, target);
#else
var rule = new LoggingRule("*", LogLevel.Error, target);
#endif
configuration.LoggingRules.Add(rule);
LogManager.Configuration = configuration;
}
/// <summary>
/// Logs an exception
/// </summary>
@ -101,6 +80,7 @@ namespace Flow.Launcher.Plugin.Program.Logger
{
var logger = LogManager.GetLogger("");
logger.Error(e, $"fail to log exception in program logger, parts length is too small: {parts.Length}, message: {message}");
return;
}
var classname = parts[0];