Terraria.ModLoader.ErrorLogger.Log C# (CSharp) Method

Log() public static method

public static Log ( string message ) : void
message string
return void
		public static void Log(string message)
		{
			Directory.CreateDirectory(LogPath);
			using (StreamWriter writer = File.AppendText(LogPath + Path.DirectorySeparatorChar + "Logs.txt"))
			{
				writer.WriteLine(message);
			}
		}

Usage Example

Exemplo n.º 1
0
 internal static void ActivateExceptionReporting()
 {
     if (exceptionReportingActive)
     {
         return;
     }
     exceptionReportingActive = true;
     AppDomain.CurrentDomain.FirstChanceException += delegate(object sender, FirstChanceExceptionEventArgs exceptionArgs)
     {
         if (exceptionArgs.Exception.Source == "MP3Sharp")
         {
             return;
         }
         float soundVolume = Main.soundVolume;
         Main.soundVolume = 0f;
         Main.NewText(exceptionArgs.Exception.Message + exceptionArgs.Exception.StackTrace, Microsoft.Xna.Framework.Color.OrangeRed);
         ErrorLogger.Log("Silently Caught Exception: " + exceptionArgs.Exception.Message + exceptionArgs.Exception.StackTrace);
         Main.soundVolume = soundVolume;
     };
 }
All Usage Examples Of Terraria.ModLoader.ErrorLogger::Log