/* * Date: 11/26/2005 * Time: 2:06 AM * * Copyright 2005, Static Boy Productions */ using System; using System.IO; namespace Jessie.Utils { /// /// Description of jtbvLog. /// public class jtbvLog { private jtbvLog() {} public static void LogToFile(string logStr) { WriteFile("JessieTheBottieVenturer.log", logStr); } public static bool WriteFile (string fileName, string writeStr) { bool retVal = false; try { System.IO.StreamWriter writer = new StreamWriter(fileName, true); writer.WriteLine(System.DateTime.Now.ToString() + "\t" + writeStr); writer.Close(); retVal = true; } catch (Exception e) { if (e is FileNotFoundException) { } else if (e is DirectoryNotFoundException) { } else if (e is IOException) { } else if (e is OutOfMemoryException) { } else { throw e; } Console.WriteLine( "Tried to write file '" + fileName + "', but there was an error. Please check the filename and permissions. " + e.Message ); } return retVal; } } }