* Added primitive exception logging capabilities.

* Disabled by default (see OpenSim.ini.example for how to enable)
* Saves exceptions to a folder on disk (default "crashes") when enabled.
* These reports can then be uploaded or posted to help debug an error.
This commit is contained in:
Adam Frisby
2008-12-09 03:06:26 +00:00
parent 8c33fcb321
commit 888151833b
3 changed files with 57 additions and 9 deletions

View File

@@ -560,6 +560,34 @@ namespace OpenSim.Framework
return ".";
}
// From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html
public static string GetUniqueFilename(string FileName)
{
int count = 0;
string Name;
if (File.Exists(FileName))
{
FileInfo f = new FileInfo(FileName);
if (!string.IsNullOrEmpty(f.Extension))
{
Name = f.FullName.Substring(0, f.FullName.LastIndexOf('.'));
}
else
{
Name = f.FullName;
}
while (File.Exists(FileName))
{
count++;
FileName = Name + count + f.Extension;
}
}
return FileName;
}
// Nini (config) related Methods
public static IConfigSource ConvertDataRowToXMLConfig(DataRow row, string fileName)
{