Opc.Ua.ServerTest.MainForm.LogMessage C# (CSharp) Method

LogMessage() private method

Logs a message.
private LogMessage ( string message ) : void
message string
return void
        private void LogMessage(string message)
        {
            if (!this.Test_NoDisplayUpdateMI.Checked)
            {
                if (ResultsTB.Text.Length > 0)
                {
                    ResultsTB.AppendText("\r\n");
                }
                
                ResultsTB.AppendText(message);
            }

            try
            {
                if (!String.IsNullOrEmpty(m_logFilePath))
                {
                    using (StreamWriter logWriter = new StreamWriter(File.Open(m_logFilePath, FileMode.Append)))
                    {
                        logWriter.WriteLine(message);
                    }
                }
            }
            catch (Exception exception)
            {
                ResultsTB.AppendText(Utils.Format("ERROR WRITING TO LOGFILE: {0}\r\n", exception.Message.ToUpperInvariant()));
            }
        }