Skip to content

Commit d74b5c8

Browse files
committed
another
1 parent 0f19010 commit d74b5c8

File tree

1 file changed

+6
-4
lines changed
  • Wox.Infrastructure/Logger

1 file changed

+6
-4
lines changed

Wox.Infrastructure/Logger/Log.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ public static class Log
1111
{
1212
public const string DirectoryName = "Logs";
1313

14+
public static string CurrentLogDirectory { get; private set; }
15+
1416
static Log()
1517
{
16-
var path = Path.Combine(Constant.DataDirectory, DirectoryName, Constant.Version);
17-
if (!Directory.Exists(path))
18+
CurrentLogDirectory = Path.Combine(Constant.DataDirectory, DirectoryName, Constant.Version);
19+
if (!Directory.Exists(CurrentLogDirectory))
1820
{
19-
Directory.CreateDirectory(path);
21+
Directory.CreateDirectory(CurrentLogDirectory);
2022
}
2123

2224
var configuration = new LoggingConfiguration();
2325
var target = new FileTarget();
2426
configuration.AddTarget("file", target);
25-
target.FileName = path.Replace(@"\", "/") + "/${shortdate}.txt";
27+
target.FileName = CurrentLogDirectory.Replace(@"\", "/") + "/${shortdate}.txt";
2628
#if DEBUG
2729
var rule = new LoggingRule("*", LogLevel.Debug, target);
2830
#else

0 commit comments

Comments
 (0)