public void Error(string msg, bool writeIntoFile) { richText?.AppendLineThreadSafe(msg, Color.Red); if (writeIntoFile) { AppendIntoFile(ConfigMgr.GetInstance().ErrorLogPath, msg); } }