File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Wox.Infrastructure/Logger Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments