mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 18:29:24 +08:00
fix log file not created (#7935)
This commit is contained in:
parent
8c7f2b6a74
commit
701c119986
@ -42,9 +42,9 @@ namespace PowerLauncher
|
||||
{
|
||||
string path = Log.CurrentLogDirectory;
|
||||
var directory = new DirectoryInfo(path);
|
||||
var log = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).First();
|
||||
var log = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).FirstOrDefault();
|
||||
|
||||
LogFilePathBox.Text = log.FullName;
|
||||
LogFilePathBox.Text = log?.FullName;
|
||||
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.AppendLine(ErrorReporting.RuntimeInfo());
|
||||
|
@ -41,8 +41,8 @@ namespace Wox.Plugin.Logger
|
||||
var rule = new LoggingRule("*", LogLevel.Info, target);
|
||||
#endif
|
||||
configuration.LoggingRules.Add(rule);
|
||||
LogManager.Configuration = configuration;
|
||||
target.Dispose();
|
||||
LogManager.Configuration = configuration;
|
||||
}
|
||||
|
||||
private static void LogInternalException(string message, System.Exception e, Type fullClassName, [CallerMemberName] string methodName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0)
|
||||
|
Loading…
Reference in New Issue
Block a user