OpenBve.Program.AppendToLogFile C# (CSharp) Méthode

AppendToLogFile() static private méthode

Appends the specified text to the log file.
static private AppendToLogFile ( string text ) : void
text string The text.
Résultat void
		internal static void AppendToLogFile(string text) {
			try {
				string file = System.IO.Path.Combine(Program.FileSystem.SettingsFolder, "log.txt");
				System.IO.File.AppendAllText(file, DateTime.Now.ToString("HH:mm:ss") + @"  " + text + Environment.NewLine, new System.Text.UTF8Encoding(false));
			} catch { }
		}

Usage Example

Exemple #1
0
        internal static void AddMessage(MessageType Type, bool FileNotFound, string Text)
        {
            if (Type == MessageType.Warning & !CurrentOptions.ShowWarningMessages)
            {
                return;
            }
            if (Type == MessageType.Error & !CurrentOptions.ShowErrorMessages)
            {
                return;
            }
            if (MessageCount == 0)
            {
                Messages = new Message[16];
            }
            else if (MessageCount >= Messages.Length)
            {
                Array.Resize <Message>(ref Messages, Messages.Length << 1);
            }
            Messages[MessageCount].Type         = Type;
            Messages[MessageCount].FileNotFound = FileNotFound;
            Messages[MessageCount].Text         = Text;
            MessageCount++;

            Program.AppendToLogFile(Text);
        }
All Usage Examples Of OpenBve.Program::AppendToLogFile