Plugin crash log no longer working
Posted: Fri Jul 26, 2024 6:42 am
Hello-
I have this code at the bottom of Plugin.cs in my plugin.
This used to write to a crash log in a folder I designated like so:
But it no longer seems to be working, i.e., when there is a crash the user only sees the OD crash message, and nothing is written to my crash logs like it used to be.
Did something change in the OD code for handling crashes recently?
I have this code at the bottom of Plugin.cs in my plugin.
Code: Select all
public override void HookException(Exception e) {
Logging.LogException(e);
System.Windows.Forms.MessageBox.Show(LanThis, "There was an error with the Anesthesia plugin. Please contact Big Idea Software at 817-807-1709 or copy the text of the crash and email it to helpdesk@bigideasoft.com. Error: " + e.ToString());
}Code: Select all
using System;
using System.IO;
namespace Anesthesia {
internal class Logging {
public static string LogDirectory="AnesthLogs";
internal static void LogException(Exception e) {
string errorText = @"\r\n" + @"\r\n"+
"Error Message: " +e.Message+"\r\nStack Trace:\r\n"+e.StackTrace+"\r\nTime of Occurrence: "+DateTime.Now
+"\r\n-----------------------------------------------------------------------------------------\r\n";
try {
if(!Directory.Exists(LogDirectory)) {
Directory.CreateDirectory(LogDirectory);
}
string path=LogDirectory+"//"+DateTime.Today.ToString("MM-dd-yyyy")+".log";
File.AppendAllText(path,errorText);
}
catch {
//Do nothing
}
}
}
}Did something change in the OD code for handling crashes recently?