File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed
Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ internal static class PathManager
1717 public static string SettingsFilePath => Path . Combine ( ConfigsFolder , "Settings.json" ) ;
1818 public static string ExtensionsFolder => Path . Combine ( TuneLabFolder , "Extensions" ) ;
1919 public static string LockFilePath => Path . Combine ( TuneLabFolder , "TuneLab.lock" ) ;
20-
20+ public static string LogFilePath { get { mLogFilePath ??= Path . Combine ( LogsFolder , "TuneLab_" + DateTime . Now . ToString ( "yyyy-MM-dd_hh-mm-ss" ) + ".log" ) ; return mLogFilePath ; } }
2121 public static string ExcutableFolder => AppDomain . CurrentDomain . BaseDirectory ;
2222 public static string ResourcesFolder => Path . Combine ( ExcutableFolder , "Resources" ) ;
2323 public static string TranslationsFolder => Path . Combine ( ResourcesFolder , "Translations" ) ;
@@ -27,4 +27,6 @@ public static void MakeSureExist(string folder)
2727 if ( ! Directory . Exists ( folder ) )
2828 Directory . CreateDirectory ( folder ) ;
2929 }
30+
31+ static string ? mLogFilePath = null ;
3032}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class Program
2525 public static void Main ( string [ ] args )
2626 {
2727 // init logger
28- Log . SetupLogger ( new FileLogger ( Path . Combine ( PathManager . LogsFolder , "TuneLab_" + DateTime . Now . ToString ( "yyyy-MM-dd_hh-mm-ss" ) + ".log" ) ) ) ;
28+ Log . SetupLogger ( new FileLogger ( PathManager . LogFilePath ) ) ;
2929 Log . Info ( "Version: " + AppInfo . Version ) ;
3030
3131 // check if other instance is running
Original file line number Diff line number Diff line change 159159"TuneLab Forum" = " TuneLab 社区"
160160"TuneLab GitHub" = " TuneLab 项目仓库"
161161"Open TuneLab Folder" = " 打开 TuneLab 文件夹"
162+ "Open Log" = " 打开日志"
162163
163164"Empty" = " 空"
164165"Check for Updates..." = " 检查更新..."
Original file line number Diff line number Diff line change @@ -936,6 +936,10 @@ Menu CreateMenu()
936936 var menuItem = new MenuItem ( ) . SetTrName ( "Open TuneLab Folder" ) . SetAction ( ( ) => ProcessHelper . OpenUrl ( PathManager . TuneLabFolder ) ) ;
937937 menuBarItem . Items . Add ( menuItem ) ;
938938 }
939+ {
940+ var menuItem = new MenuItem ( ) . SetTrName ( "Open Log" ) . SetAction ( ( ) => ProcessHelper . OpenUrl ( PathManager . LogFilePath ) ) ;
941+ menuBarItem . Items . Add ( menuItem ) ;
942+ }
939943 {
940944 var menuItem = new MenuItem ( ) . SetTrName ( "Check for Updates..." ) . SetAction ( ( ) => CheckUpdate ( false ) ) ;
941945 menuBarItem . Items . Add ( menuItem ) ;
You can’t perform that action at this time.
0 commit comments