Only save crashes to disk if save_crashes in OpenSim.ini is true (false by default).

0.6.6-post-fixes
Jeff Ames 2009-06-01 18:45:36 +00:00
parent eb330f71be
commit c6f616049c
1 changed files with 21 additions and 18 deletions

View File

@ -160,27 +160,30 @@ namespace OpenSim
m_log.ErrorFormat("[APPLICATION]: {0}", msg);
// Log exception to disk
try
if (m_saveCrashDumps)
{
if (!Directory.Exists(m_crashDir))
// Log exception to disk
try
{
Directory.CreateDirectory(m_crashDir);
if (!Directory.Exists(m_crashDir))
{
Directory.CreateDirectory(m_crashDir);
}
string log = Util.GetUniqueFilename(ex.GetType() + ".txt");
StreamWriter m_crashLog =
new StreamWriter(
Path.Combine(m_crashDir, log)
);
m_crashLog.WriteLine(msg);
m_crashLog.Close();
File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true);
}
catch (Exception e2)
{
m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2);
}
string log = Util.GetUniqueFilename(ex.GetType() + ".txt");
StreamWriter m_crashLog =
new StreamWriter(
Path.Combine(m_crashDir, log)
);
m_crashLog.WriteLine(msg);
m_crashLog.Close();
File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true);
}
catch (Exception e2)
{
m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2);
}
_IsHandlingException = false;