Move logger
This commit is contained in:
parent
cdeef7279c
commit
72aff78718
@ -76,12 +76,10 @@ namespace RageCoop.Client
|
||||
#if !NON_INTERACTIVE
|
||||
CoopMenu.DisconnectedMenuSetting();
|
||||
#endif
|
||||
|
||||
Main.Logger.Info($">> Disconnected << reason: {reason}");
|
||||
Main.QueueAction(() =>
|
||||
GTA.UI.Notification.Show("~r~Disconnected: " + reason));
|
||||
|
||||
Main.Resources.Unload();
|
||||
Main.Logger.Info($">> Disconnected << reason: {reason}");
|
||||
|
||||
|
||||
break;
|
||||
|
@ -238,6 +238,21 @@ namespace RageCoop.Client
|
||||
File.WriteAllLines("ScriptHookVDotNet.ini",lineList.ToArray());
|
||||
}
|
||||
Keys key = (Keys)Enum.Parse(typeof(Keys), reloadKey, true);
|
||||
|
||||
// Move log file so it doesn't get deleted
|
||||
Main.Logger.Dispose();
|
||||
|
||||
var path = Main.Logger.LogPath+".last.log";
|
||||
try
|
||||
{
|
||||
if (File.Exists(path)) { File.Delete(path); }
|
||||
File.Move(Main.Logger.LogPath, path);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
GTA.UI.Notification.Show(ex.Message);
|
||||
}
|
||||
|
||||
PostMessage(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle, WM_KEYDOWN, (int)key, 0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user