Beispiel #1
0
        /// <summary>Gets the logfile in some <see cref="System.String"/> representation.
        /// </summary>
        /// <returns>The logfile in its <see cref="System.String"/> representation.</returns>
        public string GetAsString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            for (int i = 0; i < m_ListOfMessages.Count; i++)
            {
                LogFileRow row = m_ListOfMessages[i];

//                stringBuilder.AppendLine(row.TimeStamp + ": <" + row.Classification.ToFormatString() + ": " + row.MessageTypeName + "> [" + m_ObjectName + "; " + m_ObjectTypeName + "] " + row.Message);
            }
            return(stringBuilder.ToString());
        }
Beispiel #2
0
        /// <summary>Gets the logfile in some <see cref="System.String"/> representation.
        /// </summary>
        /// <param name="filterFlags">The message types to take into account.</param>
        /// <returns>The <see cref="System.String"/> representation of the global logfile, where the first index corresponds to the null-based
        /// row index and the second index corresponds to the type, i.e. date, message type, object name, object type and logfile message.</returns>
        /// <remarks>The output contains some extra row, which represents the header.</remarks>
        private string[][] GetAsStringArray(int filterFlags)
        {
            List <string[]> messageList = new List <string[]>();

            string[] header = { XLResources.LogFileTimeHeader, XLResources.LogFileClassificationHeader, XLResources.LogFileMessageTypeHeader, XLResources.LogFileObjectNameHeader, XLResources.LogFileObjectTypeHeader, XLResources.LogFileMessageHeader };
            messageList.Add(header);

            for (int i = 0; i < m_ListOfMessages.Count; i++)
            {
                LogFileRow row = m_ListOfMessages[i];
                //if (((int)row.Classification & filterFlags) != 0)
                //{
                //    messageList.Add(new string[] { row.TimeStamp, row.Classification.ToFormatString(), row.MessageTypeName, m_ObjectName, m_ObjectTypeName, row.Message });
                //}
            }
            return(messageList.ToArray());
        }