Exemple #1
0
        public void Log(params object[] data)
        {
            var s = "";

            // Iterate through data to build a string.
            for (int i = 0; i < data.Length; ++i)
            {
                if (i > 0)
                {
                    s += " ";
                }
                s += (data[i] != null) ? data[i].ToString() : "null";
            }

            // Replace newlines with multiple log statements.
            if (s.IndexOf("\n") >= 0)
            {
                var a = s.Split('\n');
                foreach (var split in a)
                {
                    LOG.Add(split);
                }
            }
            else
            {
                LOG.Add(s);
            }

            // If the log is running, update it.
            UpdateLog();
        }