Move logging module initialization after setting home directory

This commit is contained in:
JustArchi
2016-08-04 22:44:17 +02:00
parent e8889fb087
commit eb886e8ca8

View File

@@ -266,14 +266,6 @@ namespace ArchiSteamFarm {
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler; TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler;
Logging.InitCoreLoggers();
Logging.LogGenericInfo("ASF V" + SharedInfo.Version);
if (!Runtime.IsRuntimeSupported) {
Logging.LogGenericError("ASF detected unsupported runtime version, program might NOT run correctly in current environment. You're running it at your own risk!");
Thread.Sleep(10000);
}
string homeDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string homeDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
if (!string.IsNullOrEmpty(homeDirectory)) { if (!string.IsNullOrEmpty(homeDirectory)) {
Directory.SetCurrentDirectory(homeDirectory); Directory.SetCurrentDirectory(homeDirectory);
@@ -296,6 +288,14 @@ namespace ArchiSteamFarm {
} }
} }
Logging.InitCoreLoggers();
Logging.LogGenericInfo("ASF V" + SharedInfo.Version);
if (!Runtime.IsRuntimeSupported) {
Logging.LogGenericError("ASF detected unsupported runtime version, program might NOT run correctly in current environment. You're running it at your own risk!");
Thread.Sleep(10000);
}
// Parse pre-init args // Parse pre-init args
if (args != null) { if (args != null) {
ParsePreInitArgs(args); ParsePreInitArgs(args);